Solve npm ERR! node-sass and gyp ERR! node-gyp error reporting issues

1. You need to install msbuild Microsoft build tool

npm install windows-build-tools --global --production

2. If you need to install a lower version of node, you can install the nvm version management tool.

If the node version in your machine is too high and you don’t want to uninstall and reinstall a lower version of node, you can install an NVM version management tool to switch node versions at any time.

1. Download and install nvm: nvm for windows
2. After installing nvm, enter the command nvm in the command window and succeed after a bunch of prompts appear.
3. Execute the install node version command to install the specified version (take 14.18.3 as an example)

nvm install v14.18.3  

Some common nvm commands:

nvm list View the existing version
nvm use v14.18.3 Switch to the specified version (take 14.18.3 as an example)
nvm uninstall 14.18.3 Uninstall the specified version

First use nvm list to view the list of node versions that have been successfully installed on this machine. If the relevant version does not appear, you can check the relevant documents: https://blog.csdn.net/qq_34373197/article/details/122809786

If npm cannot be used, it prompts: 'npm' is not an internal or external command, nor is it a runnable program.

You can check the relevant documents: https://blog.csdn.net/qq_34373197/article/details/122809786

3. If you need to install python

If python information is still prompted, it means that python needs to be installed. Just go to the python official website to download the installation package of the corresponding version and install it, usually version 2.7. python official website download

4. Reinstall node-sass

Uninstall first, then install

npm uninstall node-sass
npm install node-sass

Guess you like

Origin blog.csdn.net/xjtarzan/article/details/128949726