我有一台服务器,在该服务器上部署了Laravel-VueJs应用程序。我以前将代码推送到那里,然后运行“ npm run prod”来生成构建。今天,当我按下它并运行命令时,服务器开始给我错误。
删除了node_modules,清除了npm缓存。
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'production' ]
2 info using npm@6.9.0
3 info using node@v10.15.3
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle @~preproduction: @
6 info lifecycle @~production: @
7 verbose lifecycle @~production: unsafe-perm in lifecycle true
8 verbose lifecycle @~production: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/CRA/node_modules/.bin:/usr/local/lib/node_modules/npm/node_$
9 verbose lifecycle @~production: CWD: /var/www/CRA
10 silly lifecycle @~production: Args: [ '-c',
10 silly lifecycle 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle @~production: Returned: code: 1 signal: null
12 info lifecycle @~production: Failed to exec production script
13 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.c$
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /var/www/CRA
16 verbose Linux 4.4.0-150-generic
17 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "production"
18 verbose node v10.15.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ production: `cross-env NODE_ENV=production 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 @ production script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
预期结果:完美构建 实际结果:构建失败。