npm install常见四种报错情况以及解决方案

今天介绍一下npm install常见四种报错情况以及解决方案:

npm install常见四种报错情况以及解决方案

报错一:

mpm ERR! Unexpected end of JSON input while parsing near ...
npm ERR! errno -4048
npm ERR! syscall scandir

解决方案

npm cache clean --force
npm install

报错二:

npm error! I've never called!
npm ERR! This is an error with npm itself.

解决方案

1.删除NPM文件夹uuModules下的节点
2. 删除当前项目文件夹的node_modules
3. 删除package-lock.json文件
4. npm cache clean --force
5. npm install

报错三:

npm ERR!chromedriver@2.46.0install:`node install。js`
npm ERR! Exit status 1
npm ERR! deasync@0.1.21 install: `node ./Build. js`
npm ERR! Exit status 1
npm ERR! phantomjs-prebuilt@2.1.13 install: `node install.js`
npm ERR! Exit status 1

解决方案

类似企业所有的执行 node 命令的报错,基本都可以用我们这个研究方法进行解决#
npm install --ignore-scripts
npm install deasync@0.1.21 --ignore-scripts

报错四:

Cannot download ‘xxxx‘
HTTP error 404 Not Found

解决方案

默认下载路径上无法找到对应的资源文件,直接手动修改包的下载地址即可#
Binary site https://npm.TaoBao. Organization / mirror / node sass
Phantom= http://10.25.220.15:8080
以上是关于“npm install常见四种报错情况以及解决方案”的相关介绍,如需购买云服务器,推荐使用酷番云,独享IP,弹性灵活各种配置任您选配,最低只需要43/月,免费帮助配置环境,挂载磁盘等,协助处理简单问题,同时提供快速0元备案,让您快速运营,详情请咨询酷番云。产品选购地址:https://www.kufanyun.com/server/buy.html

图片来源于AI模型,如侵权请联系管理员。作者:路飞,如若转载,请注明出处:https://www.kufanyun.com/ask/1327.html

(0)
上一篇2021年12月20日 15:25
下一篇 2021年12月22日 14:42

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注