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 ERR! cb() never called!
npm ERR! This is an error with npm itself.
  • 解決方案
1. 刪除npm文件夾下面的node_modules
2. 刪除當前項目文件夾的node_modules
3. 刪除package-lock.json文件
4. npm cache clean --force
5. npm install
npm ERR! chromedriver@2.46.0 install: `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
  • 解決方案

默認下載路徑上無法找到對應的資源文件,直接手動修改包的下載地址即可#

sass_binary_site = https://npm.taobao.org/mirrors/node-sass
phantomjs_cdnurl = http://10.25.220.15:8080


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM