gpt4 book ai didi

node.js - 更新后的 npm 问题

转载 作者:搜寻专家 更新时间:2023-10-31 22:32:35 25 4
gpt4 key购买 nike

更新 npm 后,我无法在运行时使用 npm install

npm install

我有

npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './lib/extract-stream.js'

extract-stream.js的位置是/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js

如果我跑

/usr/local/bin/npm install   # IT WORKS!



当我运行时

which npm 
# output: {my_home_path}/.npm-global/bin/npm

当我运行时

npm -v 
# output: 6.7.0

/usr/local/bin/npm -v
# output 6.5.0

我该如何解决这个问题?

最佳答案

brew uninstall --force node    
sudo rm -rf /usr/local/lib/node_modules
brew install npm

工作得很好

关于node.js - 更新后的 npm 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54389644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com