sudo npm uninstall npm -g
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'semver'
Require stack:
- /Users/XXXX/tenv/node/v14.4.0/lib/node_modules/npm/lib/utils/unsupported.js
- /Users/XXXX/tenv/node/v14.4.0/lib/node_modules/npm/bin/npm-cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at Object.<anonymous> (/Users/XXXX/tenv/node/v14.4.0/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/XXXX/tenv/node/v14.4.0/lib/node_modules/npm/lib/utils/unsupported.js',
'/Users/XXXX/tenv/node/v14.4.0/lib/node_modules/npm/bin/npm-cli.js'
]
}
第一次安装nodejs时,编译prometheus时,抛错
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! codemirror-promql@0.19.0 build:lib: `bash ./build.sh`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the codemirror-promql@0.19.0 build:lib script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
查询资料后选择升级npm,但是升级时出现了开头的错误,但是这时候却卸载也卸载不掉,安装也无法安装,首先尝试了
sudo rm -rf /usr/local/lib/node_modules sudo rm -rf ~/.npm brew uninstall --force node brew install node
但是无果,所以一气之下就把开头抛错的/Users/XXXX/tenv/node/v14.4.0/lib/node_modules/npm文件夹删掉了,然后重新走了第一次尝试的流程,结果ok了,芜湖
|