npm install常见四种报错情况以及解决方案
今天介绍一下npm install常见四种报错情况以及解决方案:
报错一:
mpm ERR!Unexpectedend of JSON input while parsing near ...
npm ERR!errno-4048
npm ERR! syscall scandir
解决方案
npm cache clean --force
npm install
报错二:
npm error! Ive 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 404NotFound
解决方案
默认下载路径上无法找到对应的资源文件,直接手动修改包的下载地址即可#Binary site https://npm.TaoBao. Organization / mirror / node sassPhantom= http://10.25.220.15:8080以上是关于“npm install常见四种报错情况以及解决方案”的相关介绍,如需购买云服务器,推荐使用亿华云,独享IP,弹性灵活各种配置任您选配,最低只需要43/月,免费帮助配置环境,挂载磁盘等,协助处理简单问题,同时提供快速0元备案,让您快速运营,详情请咨询亿华云。产品选购地址:https://www.i658.com/cart