执行npm 出现 code ELIFECYCLE错误的几种情况

1.执行npm run test出现 code ELIFECYCLE errno 1 错误

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jesttest@1.0.0 test: `jest`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the jesttest@1.0.0 test 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!     C:\Users\Liu123\AppData\Roaming\npm-cache\_logs\2022-06-17T05_42_35_860Z-debug.log

我在csdn上查找原因,有人说是modules有缺失或者改动或者过大,试过删除项目中的node_modules和package-lock.json再重新npm install等发现还是不可以

后面在外网看到这个可以不叫错误,只是Jest 以代码 1 退出,因为测试失败。

为了防止这种情况,可以使用–silentor-s标志来避免 npm 错误消息。

npm -s run test

执行这个命令后会提示我测试代码有一个地方名称出错了,然后我进行了修改,就可以正常测试了

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        0.38 s
Ran all test suites.

2.执行 npm start 出现 code ELIFECYCLE errno 1 错误

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aip-web-template@0.1.0 start: `node --max_old_space_size=8128 --trace-deprecation scripts/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aip-web-template@0.1.0 start 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!     C:\Users\Liu123\AppData\Roaming\npm-cache\_logs\2022-06-21T01_16_02_374Z-debug.log
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值