node-sass 卸载:
npm uninstall node-sass
node-sass 安装:
npm install node-sass
node-sass 安装指定版本
npm install node-sass@6.0.0
npm install node-sass@5.0.0
npm install node-sass@4.13.0
npm install node-sass@latest

windows-build-tools 安装:(MSVC2017+Python2.7)
npm install -g windows-build-tools
npm install –global –production windows-build-tools@1.4.2

node-gyp 安装:
npm install -g node-gyp
npm install –global node-gyp@latest
for /f “delims=” %P in (‘npm prefix -g’) do npm config set node_gyp “”%P\node_modules\node-gyp\bin\node-gyp.js”

npm install –save-dev electro-rebuild
npm uninstall deasync
npm install deasync
./node_module/.bin/electro-rebuild

npm清理缓存
npm cache clean -f
npm cache clean -force

nvm安装:
https://github.com/coreybutler/nvm-windows/releases

查看本地安装的所有版本;有可选参数available,显示所有可下载的版本。
nvm ls
nvm list available
安装,命令中的版本号可自定义,具体参考命令1查询出来的列表
nvm install 11.13.0
使用特定版本
nvm use 11.13.0
卸载
nvm uninstall 11.13.0

nodejs与node-sass版本匹配:

npm设置python路径:
npm config set python C:\Python27

重新设置编译器版本和路径:
npm config set msbuild_path “C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe”
npm config set msbuild_path “D:\Program\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe”
npm config set msbuild_path “D:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe”

设置源:
npm config set registry https://registry.npm.taobao.org
npm config get registry

删除node_modules文件夹
设置数据源:npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass
npm install