解决Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Today, I checked out the nodejs front-end project in the new development environment, ran npm run serve to start the project and reported:

> Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Reason: Unclear, it may be due to a problem between node-sass and node version, but it is caused by node-sass installation failure. You need to successfully install node-sass.

deal with:

npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

I solved it using this command

Reference: (40 messages) Solution to node-sass installation failure, there is finally a solution that suits us_Mr. Xiao Liu’s hard-working blog-CSDN blog_node-sass installation failure

An error occurred when installing node-sass, prompting that node-gyp -v does not match the node version. Solution


(40 messages) An error occurred when installing node-sass, prompting that node-gyp -v does not match the node version. Solution_Target front-end boss's blog-CSDN blog

(The following is excerpted from the reference article: https://blog.csdn.net/brenda2314/article/details/105584724) 

npm uninstall node-sass
npm install node-sass

 Then I encountered:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

 Reason: Lack of python environment (refer to npm install - gyp ERR! find Python solution)

deal with:

The first method:
Install Python and configure environment variables.
Be sure to install version python2.7. For
environment variable installation, please refer to: http://blog.csdn.net/lyj_viviani/article/details/51763101
If the first method does not work, you can try it. Try the second way.
 
Second way:
Run the following code (run cmd as administrator)

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

 then met

Unexpected end of JSON input while parsing near **********

Solution execution: `npm cache clean --force`

Tried again, finally succeeded

Finally re-execute

npm uninstall node-sass
npm install node-sass

So far solved

Guess you like

Origin blog.csdn.net/qq_45530512/article/details/126481754