Tag: laravel

用Laravel灵药临界CSS

我正在使用gulp软件包的关键css ,以前我安装这个软件包: npm install –save critical 但是在运行gulp –production ,npm向我报告这个错误: mix.critical is not a function 这是我完整的gulpfile代码: var elixir = require('laravel-elixir'); var BrowserSync = require('laravel-elixir-browsersync'); var critical = require('critical'); elixir(function(mix) { mix.styles([ "bootstrap.css", "bootstrap-theme.css", "main.css", "jquery.fancybox.css", "font-awesome.css", ]).version("css/all.css") mix.critical({ src: 'http://myapp.dev', css: 'public/css/all.css', width: 1280, height: 600, dest: 'public/css/critical.css' }); }); 为什么npm报告我这个错误?

Laravel-mix – BrowserSync在event.js上抛出错误:160

不知道这个问题是否与laravel-mix相关,但是我对Browsersync软件包有问题。 这是我的mix.js: mix.js('resources/assets/js/app.js', 'public/js') .browserSync({proxy: 'localhost:8000'}) .sass('resources/assets/sass/app.scss', 'public/css'); 当我运行npm run watch-poll ( watch不接受更改,因此watch-poll 在这里看到 )我在控制台上得到以下错误: [Browsersync] Watching files… events.js:160 throw er; // Unhandled 'error' event ^ Error: watch resources/views/auth/passwords ENOSPC at exports._errnoException (util.js:1020:11) at FSWatcher.start (fs.js:1443:19) at Object.fs.watch (fs.js:1470:11) at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15) at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15) at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14) at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19) at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19) at […]

Laravel Echo Server抛出“无法设置属性'socketId'的未定义”

如果我连接到一个公共频道,一切正常。 但是,如果我连接到一个存在或私人频道,我每次都会收到以下错误。 UnhandledPromiseRejectiionWarning:未处理的承诺拒绝(拒绝ID:[某些数字]):TypeError:无法设置您的属性'socketId'未定义。 之后,我不再收到任何广播给用户的事件。 用户通过身份validation并join收听频道,但他们没有收到任何事件。 我正在使用Laravel Echo Server 1.3和Laravel 5.4以及Laravel Echo JS 这里是我得到的屏幕截图: 任何人都知道是什么原因造成的,我怎样才能修复它? 先谢谢你!

Laravel Elastic Beanstalk,无法安装运行npm?

我有我的Elastic Beanstalk与Laravel 5.4这里是我的02-node.config: commands: 01-install-node: command: "curl –silent –location https://rpm.nodesource.com/setup_8.x | s$ command: "sudo yum -y install nodejs" 和03-deploy.config container_commands: 01-laravel-deploy: command: "php artisan migrate" command: "php artisan config:clear" command: "php artisan config:cache" command: "php artisan route:clear" command: "php artisan route:cache" command: "npm install" command: "npm run prod" 在部署期间,我得到: ERROR: [Instance: i-018d9dd563f6ba0e6] Command failed on […]

如何使用AWS EB扩展编译Vuejs组件?

我在安装Nodejs和进一步在AWS Elastic Beanstalk上运行“ npm run production ”时遇到问题。 我正在编写configuration,并尝试了多个,但他们都不允许我安装nodejs。 我试图手动安装节点SSH到远程机器并运行: “ sudo yum -y install nodejs npm –enablerepo-epel ” 但它安装了节点v0.10,然后我无法运行“ npm run prod ”(我猜这是因为Laravel Homestead默认使用节点v6.11。

在Laravel 5.4中,资产编译失败

在编译laravel资源时抛出错误: ERROR Failed to compile with 2 errors error in ./resources/assets/sass/app.scss Module build failed: Error: Missing binding /media/xxx/workspace/Projects/Laravel-blog/node_modules/node-sass/vendor/linux-ia32-57/binding.node Node Sass could not find a binding for your current environment: Linux 32-bit with Node.js 8.x Found bindings for the following environments: – Linux 32-bit with Node.js 7.x 的package.json { "private": true, "scripts": { "dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js […]

Laravel Redis使用vue显示袜子数据

我用laravel创build了一个简单的事件类,如果发出通知,事件类看起来像这样, class InquirySent extends Event implements ShouldBroadcast { use SerializesModels; public $inquiries; public function __construct($inquiries) { $this->inquiries = $inquiries; } public function broadcastOn() { return ['inquiry-sent-channel']; } } 我开始这个事件(创build一个新实例): # fire inquiry notification event event(new InquirySent( $user->notifications()->where('type', InvoiceInquiry::class)->count() )); 我用这个脚本build立了我的节点服务器: var server = require('http').Server(); var io = require('socket.io')(server); // class declaration var Redis = require('ioredis'); […]

JavaScript知识库,markdown wysiwyg(和后面),图像编辑,然后出口pdf

我们有知识库(必须可用于添加/编辑),如果我们键入%ASDF%,它会将其更改为模板中知识库中定义的文本。 我想使用一些所见即所得的编辑器,如果有需要手动input一些东西的报告(不是必要的降价),但什么库/脚本将允许我插入和操纵照片(裁剪/resize,模糊等),然后把它放在任何我想要的报告拖放(就像MS Word一样)? 一切完成后,报告将被导出到PDF,但我会find一些JS库或其他方式来做到这一点。 什么将是写这个最好的框架? Node.js的? angular? PHP + Laravel + JS库? Ruby on Rails(没有ruby的经验)? 请指点我。

cross-env / dist / index.js:42意外标记}

一点背景:我正在开发一个Laravel 5应用程序。 我使用Homestead(使用Vagrant / VirtualBox)在Windows 7上本地开发,并通过CodePipeline部署到Amazon EC2实例。 在试图让Laravel Mix在本地工作的同时,我一直听到一些错误,最终导致我在全局安装cross-env的解决scheme,而不是将其包含在package.json中的devDependencies中。 当然,这也意味着我的Amazon部署也需要更新到该设置。 除了解释cross-env是全局安装在我的部署上的情况下(如果相关的话),这些都不是真正相关的。 我的package.json : { "private": true, "scripts": { … "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js –progress –hide-modules –config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.16.2", "bootstrap-sass": "^3.3.7", "jquery": "^3.1.1", "laravel-mix": "^1.0", "lodash": "^4.17.4", "vue": "^2.1.10" } } 我的部署到AWS在npm run production失败,出现以下错误: [stderr]/usr/lib/node_modules/cross-env/dist/index.js:42 [stderr] }); [stderr] ^ [stderr]SyntaxError: Unexpected token } […]

在Laravel命令类中获取Packages composer.json值

我希望能够在我为laravel开发的特定包中设置一些configuration值。 例: "extra": { "maxminddbpath": "src/storage/db" }, 我需要从我的一个类中访问这些值。 这怎么能做到。 伪代码可能看起来像这样: public function fire() { $this->getCompiler()->getPackage()->getExtra();//returns the extra node from composer.json } 对于我的例子,我将访问扩展\ Command类中的值 我倾向于同意,在某些人看来,这是一种狂热或愚蠢的行为,因为有更好的select。 我明白那个 在这种情况下,你可以回答这个问题吗?是否有任何情况下可以find一个更好的软件架构师来findconfiguration文件(composer.json)中的临时静态值? 我认为现在发生的事情是我们正在回避这个问题,说明不应该这样做。 那么可以说一个json文件的configuration与应用程序的configuration无关, 在本质上,composer.jsonconfiguration文件不能为真。 看看这个代码在github上: https : //github.com/mente/MaxMindGeoIpBundle/blob/master/Composer/ScriptHandler.php#L22 这是为交响乐而devise的,不是拉拉维尔,而是彼此的父子分支。 我假设在laravel框架内会有一些东西来处理这种请求。 其他用途可能包括: 读Grunt文件 阅读Rubyconfiguration 读取节点configuration 读取部署设置 读Vagrantconfiguration build议图书馆?