Laravel:CentOS 上的 npm 退出代码 1 代码 ELIFECYCLE

大卫·别克

我正在运行npm run devnpm run watch两者都导致退出状态 1

[user@server sub]$ npm run watch

> @ watch /home/example/public_html/sub
> npm run development -- --watch


> @ development /home/example/public_html/sub
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"

/home/example/public_html/sub/node_modules/terser-webpack-plugin/dist/index.js:375
    const optimizeFn = async (compilation, chunks) => {
                             ^

SyntaxError: Unexpected token (
    at NativeCompileCache._moduleCompile (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
    at Module._compile (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:186:36)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/example/public_html/sub/node_modules/terser-webpack-plugin/dist/cjs.js:3:16)
    at Module._compile (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/example/public_html/sub/node_modules/laravel-mix/src/builder/webpack-default.js:1:82)
    at Module._compile (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/example/public_html/sub/node_modules/laravel-mix/src/builder/WebpackConfig.js:5:28)
    at Module._compile (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/example/public_html/sub/node_modules/laravel-mix/setup/webpack.config.js:27:21)
    at Module._compile (/home/example/public_html/sub/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/example/.npm/_logs/2020-03-01T23_38_53_281Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/example/.npm/_logs/2020-03-01T23_38_53_300Z-debug.log

我试图清除 npm 缓存但由于我有最新的 NPM 版本而无法清除

[user@server sub]$ npm cache clear
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:

对于我的 NPM 版本

[user@server sub]$ npm -v
6.14.1

对于节点版本

[user@server sub]$ node -v
v6.17.1

我卡住了找不到解决方案,请任何帮助。

达里尔·克拉克

terser-webpack-plugin 需要节点 >= 8.9。

AFAIKasync()在 8.x 中被添加到节点。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

调试npm ERR!代码ELIFECYCLE npm ERR!errno 1

什么是npm ERR!代码ELIFECYCLE?

“ vue-cli-service test:unit”成功运行;但是npm退出错误代码1 ELIFECYCLE

npm ERR!代码ELIFECYCLE(开始发行)

如何解决节点服务器错误,npm ERR!代码ELIFECYCLE npm ERR!errno 1?

npm ERR!运行npm install时的代码ELIFECYCLE

npm ERR!代码ELIFECYCLE npm后安装脚本

npm run build给出npm ERR!代码ELIFECYCLE

如何解决npm错误“ npm ERR!代码ELIFECYCLE”

尝试并发运行(npm ERR!代码 ELIFECYCLE npm ERR!)

如何解决错误:迁移MD5校验和失败[1] npm ERR!代码ELIFECYCLE npm ERR!errno 1

npm run build 抛出错误代码 ELIFECYCLE

呃!运行npm start时输入代码ELIFECYCLE

npm 错误!代码 ELIFECYCLE,errno ENOENT & syscall spawn

运行“ npm run build”后收到npm错误:npm ERR!代码ELIFECYCLE npm ERR!错误2

github动作-npm安装失败,退出代码为1

运行npm i时发生错误(退出代码1)

我该如何解决'npm ERR!npm启动期间Project.js中的代码ELIFECYCLE'

我启动npm时遇到了这个问题:npm ERR!代码ELIFECYCLE

错误:ffmpeg 在 AWS Lambda 上以代码 1 退出

在设备上构建失败,退出代码为1

Debian / Armbian:.mkv文件上的mediainfo以代码1退出

npm ERR!天蓝色devops中的代码ELIFECYCLE无法使其运行

npm ERR!代码ELIFECYCLE-无法启动开发服务器

PIP安装失败,在fastlz模块上出现退出代码2 /错误代码1

在 macOS 上安装 netfilterqueue 时的错误代码(退出代码 1)

Laravel Gitlab CI / CD,错误:作业失败:退出代码1

内核以退出代码 1(VS 代码)死亡

NPM安装在GYP MAKE上失败:错误:`make`失败,退出代码:2