centos7安装nodejs后npm报错Cannot find module ‘../lib/utils/unsupported.js‘
1.移除原有npm和原软链接
cd /opt/package/node-v14.18.1-linux-x64/bin
mv npm npm.backup
rm /usr/local/bin/npm
2. 重新建立软链接
ln -s ../lib/node_modules/npm/bin/npm-cli.js ./npm
ln -s /opt/package/node-v14.18.1-linux-x64/bin/npm /usr/local/bin/