赞
踩
本地node版本太低一直升级不成功,影响npm使用
npm ERROR: npm v10.4.0 is known not to run on Node.js v12.22.12. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/. ERROR: /usr/local/lib/node_modules/npm/lib/utils/exit-handler.js:19 const hasLoadedNpm = npm?.config.loaded ^ SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at module.exports (/usr/local/lib/node_modules/npm/lib/cli-entry.js:15:23) at module.exports (/usr/local/lib/node_modules/npm/lib/es6/validate-engines.js:39:10) at module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:4:31)
如果node版本过低,git也会报错
git log /usr/local/lib/node_modules/git-split-diffs/build/index.js:1 pertySymbols,yt=Object.prototype.propertyIsEnumerable;var U=(t,e,n)=>e in t?F( ^ SyntaxError: Unexpected token > at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/usr/local/lib/node_modules/git-split-diffs/bin/git-split-diffs:3:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)
sudo apt-get remove --purge nodejs
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。