2017-02-08 85 views
1

我安装了一个新的laravel 5.4应用程序。我遵循了关于如何设置laravel组合的文档。但是,当我运行npm run dev时,出现以下错误:Laravel 5.4混合问题

0 info it worked if it ends with ok 
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'predev', 'dev', 'postdev' ] 
5 info lifecycle @~predev: @ 
6 silly lifecycle @~predev: no script for predev, continuing 
7 info lifecycle @~dev: @ 
8 verbose lifecycle @~dev: unsafe-perm in lifecycle true 
9 verbose lifecycle @~dev: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/websites/ezskillz/node_modules/.bin:/usr/bin:/home/vagrant/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games 
10 verbose lifecycle @~dev: CWD: /home/vagrant/websites/ezskillz 
11 silly lifecycle @~dev: Args: [ '-c', 
11 silly lifecycle 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ] 
12 silly lifecycle @~dev: Returned: code: 1 signal: null 
13 info lifecycle @~dev: Failed to exec dev script 
14 verbose stack Error: @ dev: `node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 
14 verbose stack Exit status 1 
14 verbose stack  at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:239:16) 
14 verbose stack  at emitTwo (events.js:100:13) 
14 verbose stack  at EventEmitter.emit (events.js:185:7) 
14 verbose stack  at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14) 
14 verbose stack  at emitTwo (events.js:100:13) 
14 verbose stack  at ChildProcess.emit (events.js:185:7) 
14 verbose stack  at maybeClose (internal/child_process.js:850:16) 
14 verbose stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) 
15 verbose pkgid @ 
16 verbose cwd /home/vagrant/websites/ezskillz 
17 error Linux 4.4.0-22-generic 
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev" 
19 error node v5.12.0 
20 error npm v3.8.6 
21 error code ELIFECYCLE 
22 error @ dev: `node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 
22 error Exit status 1 
23 error Failed at the @ dev script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'. 
23 error Make sure you have the latest version of node.js and npm installed. 
23 error If you do, this is most likely a problem with the package, 
23 error not with npm itself. 
23 error Tell the author that this fails on your system: 
23 error  node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js 
23 error You can get information on how to open an issue for this project with: 
23 error  npm bugs 
23 error Or if that isn't available, you can get their info via: 
23 error  npm owner ls 
23 error There is likely additional logging output above. 
24 verbose exit [ 1, true ] 

你知道发生了什么吗?

谢谢

+0

你更新节点/ NPM? –

+0

我如何在宅基地里做到这一点?我需要安装Hombrew来更新我的npm和节点吗? – rafiaTech

+0

我不确定,因为我没有使用Homestead,只是阅读错误日志*“请确保您安装了最新版本的node.js和npm”* –

回答

1

我想通了。感谢安迪福尔摩斯。我不得不更新我的NodeJS在宅基地运行以下命令

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 
sudo apt-get install -y nodejs 

,然后我运行下面的命令重建节点萨斯

npm rebuild node-sass 

感谢

0

我取出全部node_modules文件夹,尝试用纱线代替npm来安装包装。

  1. 删除node_modules用纱线即run yarn instead of npm install.

我希望这可以帮助别人夹

  • 重新安装软件包。

  • 0

    你有节点和NPM如果你看看行2和3中可以看到

    2 info using [email protected] 
    3 info using [email protected] 
    

    而在23行中期:

    23 error If you do, this is most likely a problem with the package, 
    23 error not with npm itself. 
    
    0

    我不知道为什么它是这个案例,不管是一个特定的版本,但是为了让我的新鲜laravel 5.4安装在我必须改变package.json中的路径时从:

    node_modules/cross-env/bin/cross-env.js 
    
    node_modules/cross-env/bin/cross-env.js 
    

    node_modules/cross-env/dist/bin/cross-env.js 
    

    注:将 “DIST”

    编辑:

    其实在一个较新的新鲜注意到安装整个

    node node_modules/cross-env/bin/cross-env.js 
    

    线简单地更换与

    cross-env 
    

    因此,例如:

    "scripts": { 
    "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 
    },