系统版本: UnionTech OS Desktop 20 Pro 1050
CPU架构:loongarch64
复现步骤:
sudo apt update
sudo apt install nodejs npm
npm --version
Error: Cannot find module 'json-parse-even-better-errors'
Require stack:
- /usr/share/nodejs/npm/node_modules/read-package-json-fast/index.js
- /usr/share/nodejs/npm/node_modules/pacote/lib/file.js
- /usr/share/nodejs/npm/node_modules/pacote/lib/git.js
- /usr/share/nodejs/npm/node_modules/pacote/lib/fetcher.js
- /usr/share/nodejs/npm/node_modules/pacote/lib/index.js
- /usr/share/nodejs/npm/lib/utils/update-notifier.js
- /usr/share/nodejs/npm/lib/cli.js
- /usr/share/nodejs/npm/bin/npm-cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/usr/share/nodejs/npm/node_modules/read-package-json-fast/index.js:4:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/usr/share/nodejs/npm/node_modules/pacote/lib/file.js:5:25)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
/usr/share/nodejs/@npmcli/config/lib/index.js:163
throw new Error('call config.load() before reading values')
^
Error: call config.load() before reading values
at Config.get (/usr/share/nodejs/@npmcli/config/lib/index.js:163:13)
at process.errorHandler (/usr/share/nodejs/npm/lib/utils/error-handler.js:171:32)
at process.emit (events.js:315:20)
at process._fatalException (internal/process/execution.js:163:25)