0
嘿,我是web dev的noob,並試圖用Laravel和Phaser。 我在Ubuntu薄荷18.1肉桂(3.2.7)64位 我總是失去了地獄與所有依賴^^運行」 故宮運行開發給我這個錯誤Npm run dev dosn't work
NPM-調試。登錄
0 info it worked if it ends with ok
1 verbose cli [ '/home/guigeek/.nvm/versions/node/v4.0.0/bin/node',
1 verbose cli '/home/guigeek/.nvm/versions/node/v4.0.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info predev @
6 info dev @
7 verbose unsafe-perm in lifecycle true
8 info @ Failed to exec dev script
9 verbose stack Error: @ 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`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (/home/guigeek/.nvm/versions/node/v4.0.0/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (/home/guigeek/.nvm/versions/node/v4.0.0/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:817:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid @
11 verbose cwd /home/guigeek/Dev/rf
12 error Linux 4.4.0-65-generic
13 error argv "/home/guigeek/.nvm/versions/node/v4.0.0/bin/node" "/home/guigeek/.nvm/versions/node/v4.0.0/bin/npm" "run" "dev"
14 error node v4.0.0
15 error npm v2.14.2
16 error code ELIFECYCLE
17 error @ 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`
17 error Exit status 1
18 error 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'.
18 error This is most likely a problem with the package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error 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
18 error You can get their info via:
18 error npm owner ls
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
這裏是我的package.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",
"jquery": "^3.1.1",
"laravel-mix": "^0.8.8",
"lodash": "^4.17.4",
"vue": "^2.1.10"
},
"dependencies": {
"webpack": "^2.3.3"
}
}
感謝您的幫助
看起來您有基於Laravel 5.4.15模板站點的package.json。 5.4.16改變了涉及交叉環境的東西。我也會研究更新nodejs/npm版本。 https://github.com/laravel/laravel/blob/v5.4.16/package.json – sisve