Tried for more than an hour to really have a kind not to start to give up the impulse, less is also enough, why do you want to make this

1, important: Installation failed, first check the Node environment version, and node-sass installation version

There are requirements between versions, which is the key issue

Version of the corresponding

Change the version number and reinstall. If it still fails…

2. Modify the image

  • Using Taobao Mirror source (recommended)
npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

// You can also set system environment variables. The sample
// Under Linux and MAC
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass

/ / the window
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ && npm install node-sass
Copy the code
  • Use CNPM (download from Taobao image by default)
NPM install -g CNPM --registry= HTTPS://registry.npm.taobao.orgNode-sass CNPM install node-sassCopy the code
  • Create the.npmrc file

Create a.npmrc file in the project root directory and add the following

phantomjs_cdnurl=http://cnpmjs.org/downloads
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org
Copy the code

Reinstall Node-sass

Python is missing (tried, but failed to install)

NPM install -g node-gyp

NPM install –global –production Windows-build-tools

Set NPM config set python to python.exe