问题出现
在使用npm装包的时候,遇到了这个WARN
npm WARN npm npm does not support Node.js v16.17.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
仔细查看发现是node和npm版本不匹配的问题,具体与node版本匹配的npm可以通过查阅版本查看
解决方法
首先,考虑直接安装最新版npm解决,结果发现报错
npm ERR! cb.apply is not a function
于是,考虑是不是应该先写在npm解决,于是先使用了uninstall方法,结果也是同样的报错
最后,只好直接到/usr/local/lib/node_modules目录下删除npm包,重新安装
brew install npm