Causes and solutions of NPM node sass installation failure

Time:2021-7-29

Causes and solutions of NPM node sass installation failure

cause: execute commands on Linux machinesnpm installThere is always a problem with the installation dependency. The error information is as follows

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Unable to find sass. Check the node sass file. There is no file in it.

So Baidu has a bunch of solutions:

  1. npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sassThen execute NPM install node sass, but it is useless. Maybe my question is not very applicable to this
  2. Delete package-lock.json and node from the project_ Modules folder, and then executenpm installNo egg use
  3. It’s the same as 1, but a few more mirror sources are useless https://www.cnblogs.com/zzgyq…
  4. Si noの the solution to node sass installation failure has not been tried. You can refer to it
  5. Directly use cnpm to install?? what?? I am invalid, you can try

Finally, the version of node and NPM is directly upgraded and then installed. My previous version is

node v16

npm v7

Demoted to

  • [ ] node v12
  • [] NPM V6 is enough

NPM downgrade commandnpm install [email protected] -gthat will do

For node degradation, it is recommended to use the plug-in NVM

How to use it can be referred to here

Correct opening method of NVM


After reading an article just now, I suddenly realized that it was the node version:

Why does node sass always fail to install

Recommended Today

Implementation example of go operation etcd

etcdIt is an open-source, distributed key value pair data storage system, which provides shared configuration, service registration and discovery. This paper mainly introduces the installation and use of etcd. Etcdetcd introduction etcdIt is an open source and highly available distributed key value storage system developed with go language, which can be used to configure sharing […]