为了账号安全,请及时绑定邮箱和手机立即绑定

错误的ERR!代码ELIFECYCLE

错误的ERR!代码ELIFECYCLE

宝慕林4294392 2019-08-31 14:40:35
我正在尝试学习反应,所以我有这个示例代码为fullstack反应投票应用程序,我试图让它工作,但在运行npm install后跟npm start我收到以下错误:npm ERR! Darwin 16.4.0npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server"npm ERR! node v7.5.0npm ERR! npm  v4.3.0npm ERR! file shnpm ERR! code ELIFECYCLEnpm ERR! errno ENOENTnpm ERR! syscall spawnnpm ERR! voting_app@1.1.0 server: `live-server --public --    host=localhost --port=3000 --middleware=./disable-browser-cache.js`npm ERR! spawn ENOENTnpm ERR!npm ERR! Failed at the voting_app@1.1.0 server script 'live-server --public --host=localhost --port=3000 --middleware=./disable-browser- cache.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 voting_app  package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR!     live-server --public --host=localhost --port=3000 --  middleware=./disable-browser-cache.jsnpm ERR! You can get information on how to open an issue for this  project with:npm ERR!     npm bugs voting_appnpm ERR! Or if that isn't available, you can get their info via:npm ERR!     npm owner ls voting_appnpm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:npm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_581Z-debug.lognpm ERR! Darwin 16.4.0npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"npm ERR! node v7.5.0npm ERR! npm  v4.3.0npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! voting_app@1.1.0 start: `npm run server`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the voting_app@1.1.0 start script 'npm run server'.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 voting_app    package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR!     npm run server
查看完整描述

3 回答

?
偶然的你

TA贡献1841条经验 获得超3个赞

步骤1: $ npm cache clean --force

步骤2:按文件夹删除node_modules$ rm -rf node_modules或通过进入目录手动删除它,然后右键单击>删除。也删除package-lock.json文件。

第3步: npm install

重新开始 $ npm start

这对我有用。希望它也适合你。

PS:如果它在那里,请检查它以红色显示的错误并采取相应措施。此错误特定于node.js环境。快乐编码!!


查看完整回答
反对 回复 2019-08-31
?
慕田峪7331174

TA贡献1828条经验 获得超13个赞

清洁CacheNode_module不够。请遵循以下步骤:

  • npm cache clean --force

  • 删除node_modules文件夹

  • 删除package-lock.json文件

  • npm install

它对我有用。


查看完整回答
反对 回复 2019-08-31
?
慕桂英3389331

TA贡献2036条经验 获得超8个赞

我先跑了:


npm run clean

(即使它有错误)


然后我删除了node_modules文件夹并运行


npm install

这似乎解决了这个问题。


查看完整回答
反对 回复 2019-08-31
  • 3 回答
  • 0 关注
  • 1515 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信