mac|mac npm install 报''Error: Cannot find module 'semver'''
mac环境下 npm install 报'' Error: Cannot find module 'semver' ''
edward@Edward:~$sudo npm install cordova -g
module.js:487
throw err;
^Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
【mac|mac npm install 报''Error: Cannot find module 'semver'''】需要重新安装node
sudo rm -rf /usr/local/lib/node_modulessudo rm -rf ~/.npmbrew uninstall --force node(会提示:
Error: Refusing to uninstall /usr/local/Cellar/node/8.1.4
because it is required by yarn 0.27.5, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies node
)brew install node
推荐阅读
- macOS开发环境学习笔记
- intellij-idea|JetBrains IntelliJ IDEA 2021 for Mac(Java开发工具)
- intellij-idea|解决MAC下应用程序“IntelliJ IDEA”无法打开(JetBrains全家桶同理)
- Mac/Linux|Mac/Linux POS系統架構
- mac删除分区并合并分区(转载)
- 关于MAC M1处理器运行Android protoc报错的解决方案
- How to Install & Configure VNC Server on Ubuntu 22.04 or 20.04
- idea|idea mac 查找文件快捷键_mac下idea工具快捷键使用
- 数据科学|Machine Learning 高频面试题
- ORACLE|How to install oracle19c in Centos8