【问题标题】:Always having to delete node_modules and reinstalling the packages again for npm run prod to work始终必须删除 node_modules 并再次重新安装软件包才能使 npm run prod 正常工作
【发布时间】:2019-06-30 12:30:35
【问题描述】:

我一直遇到这个问题,

$ npm run production

@ production /var/www/html/****
 cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

xnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ production: cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ production 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!     /root/.npm/_logs/2019-02-06T13_49_22_325Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ prod: npm run production
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ prod 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!     /root/.npm/_logs/2019-02-06T13_49_22_696Z-debug.log

每次发生这种情况时,我都必须删除 node_modules 并运行 npm install ,然后再次运行 npm run production ,然后再运行。

【问题讨论】:

  • 你的问题是什么?
  • 那么可能会发生什么,或者我做错了什么,以至于一旦我运行npm run prod,下次我必须删除节点模块
  • 您应该在 prod 运行前后检查文件的权限。有时错误的权限会导致失败。

标签: node.js laravel vue.js npm laravel-mix


【解决方案1】:

只需重新启动服务器上的更新包。现在一切正常。

apt update restart now

【讨论】:

    猜你喜欢
    • 2021-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-15
    • 1970-01-01
    • 2022-01-16
    • 2021-02-24
    • 2020-06-14
    相关资源
    最近更新 更多