npm install 下载依赖报错解决方法

拉取项目下来后,下载依赖报错,如下:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @sentry/cli@1.72.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @sentry/cli@1.72.0 install 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:\Program Files\nodejs\node_cache\_logs\2022-04-28T08_47_23_030Z-d

根据报错可知,在下载依赖过程中,有一个包@sentry/cli@1.72.0下载不下来,网上查找资料:

文章链接:https://segmentfault.com/a/1190000008474798

解决方式:单独安装这个报错的包,加上参数:–ignore-scripts

npm i @sentry/cli@1.72.0 --ignore-scripts 

控制台显示@sentry/cli@1.72.0下载成功

 

再在终端npm i下载依赖就可以下载下来了

原理是什么我暂时不知道,要是知道后面我会在这里加上,有前辈知道请指教一下我,嘿嘿


版权声明:本文为qq_52335038原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。