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根目錄