Ошибка node sass

Troubleshooting

This document covers some common node-sass issues and how to resolve them. You
should always follow these steps before opening a new issue.

TOC

  • Installation problems
    • 404 downloading binding.node file
  • Glossary
    • Which node runtime am I using?
    • Which version of node am I using?
    • Debugging installation issues.
      • Windows
      • Linux/OSX
  • Using node-sass with Visual Studio 2015 Task Runner.
  • Installing node-sass 4.x with Node < 4

Installation

404s

If you see a 404 when trying to install node-sass, this indicates that you’re trying
to install a version of node-sass that doesn’t support your version of NodeJS, or
uses an alternate V8 environment (Meteor, Electron, etc…) that isn’t supported
by node-sass.

> node-sass@4.6.1 install /src/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releas…
Cannot download "https://github.com/sass/node-sass/releas…":

HTTP error 404 Not Found

If you encounter this, please check what version of NodeJs you’re running (node -v)
and check for a supported version of node-sass for your NodeJs by checking our
release page.

Proxy issues

If you work in behind a corporate proxy try setting the proxy variables. The
following is a guide for setting this up.

Running with sudo or as root

This can happen if you are install node-sass as root, or globally with sudo.
This is a security feature of npm. You should always avoid running npm as
sudo because install scripts can be unintentionally malicious.
Please check npm documentation on fixing permissions.

If you must however, you can work around this error by using the --unsafe-perm
flag with npm install i.e.

sudo npm install --unsafe-perm -g node-sass

If this didn’t solve your problem please open an issue with the output from
our debugging script.

npm

Some users upgrading from previous versions of npm before 5 have found conflicts with
old lock file formats. This may be show up as a URL instead of the actual version
number when downloading the binary. EX:

Downloading binary from https://github.com/sass/node-sass/releases/download/vhttps://registry.npmjs.org/node-sass/-/node-sass-4.5.3.tgz/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/vhttps://registry.npmjs.org/node-sass/-/node-sass-4.5.3.tgz/win32-x64-57_binding.node":

HTTP error 404 Not Found

The easiest way to get around this is just to cleanup the npm files and reinstall.

rm -rf node_modules
rm package-lock.json
npm cache clean
npm install

Helping us, help you

Find what version of Node you’re running

To determine which version of Node.js or io.js you are currently using run the
following command in a terminal.

The resulting value the version you are running.

Debugging installation issues

Node sass runs some install scripts to make it as easy to use as possible, but
some times there can be issues. Before opening a new issue please follow the
instructions for Windows or Linux/OSX and provide
their output in you GitHub issue.

Remember to always search before opening a new issue.

Windows

Firstly create a clean work space.

Check your COMSPEC environment variable.

node -p process.env.comspec

Please make sure the variable points to C:WINDOWSSystem32cmd.exe

Gather some basic diagnostic information.

npm -v
node -v
node -p process.versions
node -p process.platform
node -p process.arch

Clean npm cache

Install the latest node-sass

npm install node-sass@latest

Note which version was installed by running

y@1.0.0 /tmp
└── node-sass@3.8.0

If node-sass couldn’t be installed successfully, please publish your npm.log
and npm.err files for analysis.

You can download reference known-good logfiles
to compare your log against.

If node-sass install successfully lets gather some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If the node-sass installation process produced an error, open the vendor folder.

cd node_modulesnode-sassvendor

Then, using the version number we gather at the beginning, go to https://github.com/sass/node-sass/releases/tag/v<your-version>.

There you should see a folder with same name as the one in the vendor folder.
Download the binding.node file from that folder and replace your own with it.

Test if that worked by gathering some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If this still produces an error please open an issue with the output from these
steps.

Linux/OSX

Firstly create a clean work space.

Gather some basic diagnostic information.

npm -v
node -v
node -p process.versions
node -p process.platform
node -p process.arch

Install the latest node-sass

npm install node-sass@latest

Note which version was installed by running

y@1.0.0 /tmp
└── node-sass@3.8.0

If node-sass install successfully lets gather some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If the node-sass installation process produced an error, open the vendor folder.

cd node_modules/node-sass/vendor

Then, using the version number we gather at the beginning, go to https://github.com/sass/node-sass/releases/tag/v<your-version>.

There you should see a folder with same name as the one in the vendor folder.
Download the binding.node file from that folder and replace your own with it.

Test if that worked by gathering some basic installation information.

node -p "require('node-sass').info"
node-sass       3.8.0   (Wrapper)       [JavaScript]
libsass         3.3.6   (Sass Compiler) [C/C++]

If this still produces an error please open an issue with the output from these
steps.

Using node-sass with Visual Studio 2015 Task Runner

If you are using node-sass with VS2015 Task Runner Explorer, you need to make
sure that the version of node.js is same as the one you installed node-sass
with. This is because for each node.js runtime modules version (node -p process.versions.modules)
, we have a separate build of native binary. See #532.

Alternatively, if you prefer using system-installed node.js (supposedly higher
version than one bundles with VS2015), you may want to point Visual Studio 2015
to use it for task runner jobs by following the guidelines.

Installing node-sass 4.x with Node < 4

See the discussion in this comment
for a workaround. As of node-sass@v5 only Node 6 and above will be officially supported.

I am trying to install node-sass in a project, which perfectly builds and runs on my pc but on my surface I am having major issues when trying to install the packages.

Note: I have tryed reinstalling and rebuilding the project several times.

Summary of the error:

gyp ERR! build error
gyp ERR! stack Error: `C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0BinMSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:UsersMax-TDocumentsSourcesStaffMangerV2black-dashboard-pro-react-v1.0.0node_modulesnode-gyplibbuild.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Max-T\Documents\Sources\StaffMangerV2\black-dashboard-pro-react-v1.0.0\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:UsersMax-TDocumentsSourcesStaffMangerV2black-dashboard-pro-react-v1.0.0node_modulesnode-sass
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modulesreact-scriptsnode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersMax-TAppDataRoamingnpm-cache_logs2019-10-30T10_05_01_386Z-debug.log

package.json => https://hastebin.com/azetegukes.pl
too much coode so I had to paste it elsewhere.

asked Oct 30, 2019 at 10:14

Maxdola's user avatar

5

If anyone runs into this lately… the easiest fix is to replace node-sass with just sass in your dependencies. It’s the more recently maintained version and I only had to change 1 line of code with how it’s initialized and all of my existing code was already compatible.

There are more details at https://sass-lang.com/blog/libsass-is-deprecated under How to migrate.

answered Dec 12, 2021 at 13:25

Matt Toigo's user avatar

Matt ToigoMatt Toigo

6491 gold badge6 silver badges6 bronze badges

3

Don’t use node-sass anymore

node-sass is deprecated. Instead use the new version which is sass.

You can uninstall the old and install the new one with this command

npm uninstall node-sass
npm install sass

answered Aug 10, 2022 at 20:07

Abraham's user avatar

AbrahamAbraham

11.1k3 gold badges52 silver badges83 bronze badges

2

try this command it works for me

sudo npm install -g --unsafe-perm node-sass

answered Apr 28, 2020 at 9:25

Alireza Ebrahimkhani's user avatar

2

After more than 2 hours of trying all sorts of ways (cleaning npm cache, deleting node_modules, trying to install with global switch -g, etc.) to install node-sass and failing every time, I finally changed the mirror to china and it immediately worked for me!! (I know it kinda doesn’t make any sense, considering the error I was getting)

Just for reference, this was the error I was receiving before it finally worked:

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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:Users****AppDataRoamingnpm-cache_logs2020-06-06T13_56_56_768Z-debug.log

My Node version: v12.18.0
node-sass version in package.json: «^4.14.0»

I changed the mirror as stated in the node-sass npm page.

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass

Hope that helps.

answered Jun 6, 2020 at 14:25

Sнаđошƒаӽ's user avatar

SнаđошƒаӽSнаđошƒаӽ

16.6k12 gold badges72 silver badges89 bronze badges

0

The best option would probably be to replace node-sass lib with sass one.
But in our case I fixed that by installing nvm and setting local node version to 14.17.6
My node-sass version is 4.14.1

answered Feb 1, 2022 at 10:29

Aliaksei's user avatar

AliakseiAliaksei

9969 silver badges16 bronze badges

Introduction

Recently I was trying to fix a bug with one of my old projects. So I went to git and did a clone and ran

npm install

The project uses node-sass to complile scss files to CSS and came up with the error:

npm ERR! command failed

A more verbose error looks like the following:

npm ERR! code 1
npm ERR! path D:myprojectnode_modulesgulp-sassnode_modulesnode-sass
npm ERR! command failed
npm ERR! command C:Windowssystem32cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:Program Filesnodejsnode.exe D:myprojectnode_modulesgulp-sassnode_modulesnode-gypbinnode-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
...
...
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@17.3.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (D:myprojectnode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:myprojectnode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:myprojectnode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at D:myprojectnode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (D:myprojectnode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:myprojectnode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:myprojectnode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at D:myprojectnode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (D:myprojectnode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:myprojectnode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:myprojectnode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at D:myprojectnode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (D:myprojectnode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:myprojectnode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:myprojectnode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at D:myprojectnode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at D:myprojectnode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". guessing location
npm ERR! gyp verb ensuring that file exists: C:Python27python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (D:myprojectnode_modulesgulp-sassnode_modulesnode-gyplibconfigure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (D:myprojectnode_modulesgulp-sassnode_modulesnode-gyplibconfigure.js:509:16)
npm ERR! gyp ERR! stack     at D:myprojectnode_modulesgraceful-fspolyfills.js:282:31
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\,yproject\node_modules\gulp-sass\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:myprojectnode_modulesgulp-sassnode_modulesnode-sass
npm ERR! gyp ERR! node -v v17.3.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

Why is node-sass failing to install?

Node-sass is a popular package used in Node.js applications to compile Sass files into CSS.
This means that you can specify the .scss file and get it compiled to css.

The main reason why node-sass would be failing is that its been deprecated and the team behind SASS recommends using Dart SASS or sass for short.

Steps to fix this issue

  1. Updgrade node-sass with sass
  2. Make sure you are using a compatible version of node-sass with Node
  3. Make sure to have installed node-sass and its dependencies on your machine
  4. Clear out the node_modules, package-lock.json and install again
  5. Use the flag --unsafe-perm

Tip: The obvious step is to not use node-sass but sass

1. Updgrade node-sass with sass

Node-sass has been deprecated and the team behind it recommends using sass.

We just need to remove it as follows:

npm uninstall node-sass --save

Then install sass:

Now if you want to use node-sass for some reason, then follow the next steps.

2. Make sure you are using a compatible version of node-sass with Node

So if you do not want to use the new Dart SASS (sass) and still want to use node-sass, we can change our node version to use a version thats compatible with node-sass

The following table lists the compatible versions of Node with Node-sass:

NodeJS Supported node-sass version Node Module
Node 19 8.0+ 111
Node 18 8.0+ 108
Node 17 7.0+, <8.0 102
Node 16 6.0+ 93
Node 15 5.0+, <7.0 88
Node 14 4.14+ 83
Node 13 4.13+, <5.0 79
Node 12 4.12+, <8.0 72
Node 11 4.10+, <5.0 67
Node 10 4.9+, <6.0 64
Node 8 4.5.3+, <5.0 57
Node <8 <5.0 <57

One good tool to use to manage Node versions is NVM!

To work with NVM and manage your Node versions we can do the following:

  1. For windows, we can go to the binary and install NVM located here:

https://github.com/coreybutler/nvm-windows/tags

For linux distros we can do the following:

sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install node 
  1. Uninstall all versions of node with the following command:

nvm uninstall <node version>

  1. Reinstall needed node version:

nvm install <node version>

To get the latest node version we can do nvm install latest

  1. Use node version just installed:

nvm use <node version>

In our case, we can use the command nvm use latest

3. Make sure to have installed node-sass and its dependencies on your machine

node-sass requires a bunch of dependencies and they are required to be installed on your machine first.

In general, make sure that you have installed Python and a build/compiler toolchain. This would vary across systems.

For Unix

  • Python v3.7, v3.8, v3.9, or v3.10
  • make
  • C/C++ compiler toolchain eg GCC

For OSX

  • Python v3.7, v3.8, v3.9, or v3.10
  • XCode Command Line Tools which will install clang, clang++, and make.

On Windows

  • Python v3.7, v3.8, v3.9, or v3.10, head over to the Microsoft Store and download the latest version.

  • Install the Visual C++ Build Environment. You can do this by either getting the “Visual C++ build tools” workload in Visual Studio Build Tools or by using the “Desktop development with C++” workload in Visual Studio Community.

  • Open up cmd and type in “npm config set msvs_version 2017”.

Note: If you’re looking to target native ARM64 Node.js on Windows 10 on ARM, make sure to add the components “Visual C++ compilers and libraries for ARM64” and “Visual C++ ATL for ARM64”.

4. Clear out the node_modules, package-lock.json and install again

When previous steps did not work for you, the final option is to nuke everything.

Open up your terminal and go to the project’s root folder:

  1. Delete node_modules folder. This is where all the packages are saved.
  2. Delete the package-lock.json.
  3. Run npm install

Note: Make sure you are running under administrator priveleges.

5. Use the flag --unsafe-perm

If you know what you are getting into, then try installing node-sass with the --unsafe-perm flag.

This flag allows npm to run scripts with root privileges.

You can install node-sass with the --unsafe-perm flag by running the following command in your terminal:

npm install node-sass --unsafe-perm

Summary

When working on old projects you may come across NPM install errors with node-sass. The main reason this is the case is because node-sass has been deprecated by the team behind it.

It is recommended to use sass instead. If somehow you still need to use node-sass there are a few things to check to get your project up and running:

  • check that the version of node-sass is compatible with your version of Node
  • make sure that you have all the dependencies installed on your machine — eg Python and build/compile tools
  • clear our your node_modules folder and package-lock.json and run the npm install again
  • Try using the --unsafe-perm flag if you know what you are doing!

Node Sass does not yet support your current environment

If you ever update your version of node then you might start running into the “Node Sass does not yet support your current environment” error. I’ve had this happen a few times (including today), and thought that it might be nice to put a fix here for anyone who might be looking.

This problem happens because the version of node-sass that you have installed is no longer compatible with the version of node you are trying to run it with. I guess this could work either way, but it is more likely that your node-sass version is behind; which is nice, because I would rather upgrade an npm package than downgrade node.

Here are a couple of things you could try. Don’t worry, they are nice and quick, with little fuss.

Note: If you have installed node-sass globally then you will need to run with a ‘-g’ flag.

Rebuild node-sass

npm rebuild node-sass

or

npm rebuild -g node-sass

Running rebuild basically recompiles the package to match the new node version. However, if this doesn’t work for you (which it doesn’t for me) then your best bet is to uninstall and reinstall node-sass.

Uninstall and re-install node-sass

npm uninstall node-sass && npm install node-sass

or

npm uninstall -g node-sass && npm install -g node-sass

Yup, that’s right. If it doesn’t work, wipe it clean and start again!

You might like:

Create, register and use shortcodes in WordPress

Create, register and use shortcodes in WordPress

by Gav
18/03/2023

Learn how to create and register your own WordPress shortcodes to add dynamic content to your posts and pages.

How to use guard clauses in JavaScript

How to/why use guard clauses in JavaScript

by Gav
16/03/2023

Learn how to improve code readability and performance by using guard clauses in JavaScript. Discover their benefits and best practices.

Implements and Extends, Object Oriented TypeScript

Implements and Extends, Object Oriented TypeScript

by Gav
15/03/2023

Learn the difference between implements and extends in TypeScript. Use Implements to implement interfaces and types, and extends to inherit from classes.

Reading/Parsing and Writing YAML files in PHP, Symfony

Reading/Parsing and Writing YAML files, PHP Symfony

by Gav
14/03/2023

In this tutorial we will look at using YAML in PHP. Learn about Parsing and Writing YAML files using Symfony’s YAML component.

Measuring code execution performance in JavaScript

Measuring code execution performance in JavaScript

by Gav
13/03/2023

Measuring code execution performance is an important way to identify bottlenecks. Use these methods in JavaScript to help optimise your code.

Measuring script/code execution time in PHP using microtime

Measuring script/code execution time in PHP, microtime

by Gav
06/03/2023

Find bottlenecks, optimise and clean your code, and speed up your apps by measuring the execution time of your PHP scripts using microtime.

Regenerate WordPress media image sizes, programmatically

Regenerate WordPress media image sizes, programmatically

by Gav
25/02/2021

Learn how to regenerate and update WordPress media and image sizes both programmatically (without plugin), and also with a handy plugin.

Magic Constants in PHP. What they are and how to use them.

Magic Constants in PHP. What they are and how to use them

by Gav
15/02/2021

Ever seen constants like __DIR__ and __FILE__ being used in PHP? These are ‘Magic Constants’, and this is how we can use them.

Detecting Keypress JavaScript

Detect single and multiple keypress events: JavaScript

by Gav
16/10/2019

Learn how to use event listeners to detect and handle single and multiple keypress events in JavaScript. Add modifier keys to your application!

verifiedanswer

While Using Sass I was face the following error Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 in my react web app. Then I found a solution To fix Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 error You Just need to use sass instead of node-sass will resolve this error. Here I am going to share the solution step by step. Let’s get started with this article.

How To Fix Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 Error?

How To fix Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 error?

To fix Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 error If You are using Yarn Dependencies then You should use this command. First of all, just uninstall node-sass by running the following command: yarn remove node-sass now, You need to install sass by running this command: yarn add sass Now, your error will be solved. Thank you.

Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

To fix Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 error You just need to use Sass Instead of node-sass because of node-sass is deprecated so You need to remove node-sass you can use this command: npm uninstall node-sass It will uninstall node-sass from your project and now You need to install sass you can use this command: npm install sass Now If You are using sass-loader then I would recommend you to reinstall sass-loader with the following command: npm uninstall sass-loader && npm install sass-loader Now, your error will be solved. Thanks.

Verified Answer: Use Sass Instead of node-sass

To fix Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 error You just need to use SassInstead of node-sass because node-sass is deprecated so You need to remove node-sass you can use this command.

npm uninstall node-sass

Enter fullscreen mode

Exit fullscreen mode

It will uninstall node-sass from your project and now You need to install sass you can use this command.

npm install sass

Enter fullscreen mode

Exit fullscreen mode

Now If You are using sass-loader then I would recommend you to reinstall sass-loader with the following command.

npm uninstall sass-loader
npm install sass-loader

Enter fullscreen mode

Exit fullscreen mode

Now, your error will be solved. Thanks.

Answer 2: For Yarn Users

If You are using Yarn Dependencies then You should use this command. First of all, just uninstall node-sass by running the following command.

yarn remove node-sass

Enter fullscreen mode

Exit fullscreen mode

And now, You need to install sass by running this command.

yarn add sass

Enter fullscreen mode

Exit fullscreen mode

Now, your error will be solved. Thank you.

Final Word

You just need to and Then Your error will be solved. If You have any suggestions, queries, or thoughts then Please Comment below. Hope Our Article helps you to solve your error. Thank you.

Also, Read

  • Cannot find module ‘react-dom/client’ from ‘node_modules/@testing-library/react/dist/pure.js’
  • ImportError: libGL.so.1: cannot open shared object file: No such file or directory
  • selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 104 Current browser version is 106

Понравилась статья? Поделить с друзьями:
  • Ошибка node exe
  • Ошибка noch на приставке триколор как устранить
  • Ошибка no xeldz
  • Ошибка no user logon cs go
  • Ошибка no symbols loaded