1、nodejs在program files下面会造成一些项目中的问题,因此nodejs在program files下需要先卸载nodejs
2、安装nodejs到自定义的目录下面,例:D:\nodejs
3、node安装成功后,在D:\nodejs目录下创建两个新文件夹
node_global
node_cache
4、执行配置命令
npm config set prefix "D:\nodejs\node_global"
npm config set cache "D:\nodejs\node_cache"
5、配置环境变量,配置nodejs根目录,配置node_global根目录