2017-04-13 108 views
0

FIXED:的解決辦法是刪除該文件夾node_modules並重新運行NPM INSTAL,並在此之後一切工作。Laravel 5.4 NPM運行dev的錯誤

我有一些問題Laravel並試圖運行 「故宮運行dev的」,我得到這個錯誤:

   Asset  Size Chunks     Chunk Names 
     /js/app.js 1.18 MB  0 [emitted] [big] /js/app 
mix-manifest.json 32 bytes   [emitted]   
npm ERR! code ELIFECYCLE 
npm ERR! errno 2 
npm ERR! @ dev: `node node_modules/cross-env/dist/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` 
npm ERR! Exit status 2 
npm ERR! 
npm ERR! Failed at the @ dev script 'node node_modules/cross-env/dist/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'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node node_modules/cross-env/dist/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 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls 
npm ERR! There is likely additional logging output above. 

我NPM的版本和節點是:

NPM:4.5。 0 節點:v7.8.0

而Laravel 5.4

這裏是我的packages.json:

{ 
    "private": true, 
    "scripts": { 
    "dev": "node node_modules/cross-env/dist/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", 
    "watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js 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": "node node_modules/cross-env/dist/bin/cross-env.js 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": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 
    }, 
    "devDependencies": { 
    "axios": "^0.15.3", 
    "bootstrap-sass": "^3.3.7", 
    "cross-env": "^3.2.3", 
    "jquery": "^3.1.1", 
    "laravel-mix": "0.*", 
    "lodash": "^4.17.4", 
    "vue": "^2.1.10" 
    }, 
    "dependencies": { 
    "webpack": "^2.3.3" 
    } 
} 

任何解決方案?

+0

你有你的根目錄下的'webpack.mix.js'文件? –

+0

你在Windows機器上運行嗎? https://laravel.com/docs/5.4/mix#running-mix =>刪除文件夾node_modules並重新運行NPM安裝這樣的:NPM安裝--no斌鏈接 –

+0

我在webpack.mix.js我的根,在這裏沒有改變任何東西。還我運行的Mac –

回答

0

我做laravel的全新安裝,更新了我的節點和故宮和所有工作正常,按照這些步驟

npm install 
npm install cross-env -D 
npm run dev