- npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”
- npm install –global –production windows-build-tools
- 如果很慢,可以改为国内源
- npm config set registry https://registry.npm.taobao.org
2 .error C2661: “v8::Object::Get”: 没有重载函数接受 1 个参数
node-sass没有安装好
删掉失败的node_modules:
rmdir /s node_modules
安装node-gyp
npm install -g node-gyp
卸载node-sass
npm uninstall node-sass
去https://github.com/sass/node-sass/releases 下载与本机nodejs版本对应的node-sass,一般为
win32-x64-xx_binding.node
设置环境变量:set SASS_BINARY_PATH=E:\win32-x64-xx_binding.node
然后,npm install -g node-sass ,如果失败,看看有没有这两句话
npm ERR! NODE_MODULE_VERSION 102. This version of Node.js requires
npm ERR! NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
如果有,重新去下载一个win32-x64-83_binding.node
重新设置环境变量set SASS_BINARY_PATH=E:\win32-x64-83_binding.node
再次执行npm install -g node-sass
确认node_modules已删
重新执行yarn install