查看镜像源使用状态:npm config get registry 切换到官方镜像源:npm config set registry http://www.npmjs.org 切换到淘宝镜像源:npm config set registry http://registry.npm.taobao.org
切换npm源:
1
npm config set registry http://registry.npm.taobao.org
Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/nrm/node_modules/open/in [root@Centos9-Stream blog]# nrm ls /usr/local/lib/node_modules/nrm/cli.js:9 const open = require('open'); ^
Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/nrm/node_modules/open/index.js from /usr/local/lib/node_modules/nrm/cli.js not supported. Instead change the require of index.js in /usr/local/lib/node_modules/nrm/cli.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/usr/local/lib/node_modules/nrm/cli.js:9:14) { code: 'ERR_REQUIRE_ESM' }