npm install 时遇到 cb() never called

Javascript · 04-18 · 110 人浏览

今天开了个新项目,但是install前端的时候一直报错,12、14、16全都是一个问题,头疼,后来找了半天终于在stackoverflow上找到解决办法

解决办法

第一种

npm cache clean --force

第二种

# 先找找npm有哪些配置
npm config list
# ; cli configs
# metrics-registry = "https://registry.npm.taobao.org/"
# scope = ""
# user-agent = "npm/6.14.18 node/v14.21.3 darwin x64"
# 
# ; userconfig /Users/gzy/.npmrc
# https-proxy = "http://localhost:10808/"
# proxy = "http://localhost:10808/"
# registry = "https://registry.npm.taobao.org/"
# 
# ; node bin location = /Users/gzy/.nvm/versions/node/v14.21.3/bin/node
# ; cwd = /Users/gzy/IdeaProjects/gs-registration/ruoyi-ui
# ; HOME = /Users/gzy
# ; "npm config ls -l" to show all defaults.

# 可以看到这里有两个代理,我们把配置恢复原样
npm config set https-proxy ""
npm config set proxy ""

npm install
# 恢复正常了
javascript npm
Theme Jasmine by Kent Liao