Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version - npm

Can you help me? I got this error when I hit ng s
ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss)
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/app.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/detail-view/detail-view.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/footer/footer.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/products/products.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/slider/slider.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/header/header.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)

You need to run npm rebuild (or npm rb) in your project folder.
This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.
Source

This worked for me
npm install --save-dev node-sass

npm rebuild node-sass --force : should work

npm rebuild --force - this will rebuild all packages. Only this worked for me

Try rebuilding node-sass using npm rebuild node-sass and check if that fixes your issue.

working solution
Step 1 rm -rf node_modules it removes the directory recursively (the existing node modules, takes a min or two)
Step 2 npm install this will work for sure, i did try and it worked.

If you are facing this issue even after upgrading node-saas to version above 4 then follow below thread
Sass-loader requires node-sass >=4 even if that exist

Re-installing webpack solved the issue for me.
npm install --save-dev webpack
or, you can try :
npm rebuild node-sass

check for the supported version. As on date I had node 12.x installed on my machine and spent an hour running npm install node-sass and npm rebuild node-sass with --force and --save-dev hints.
Nothing worked until I uninstalled the node 12.x and installed node 10.x. So if you're hitting the same problem and could not get it to work, try following
Check if your Node version (Run node -v) if it's higher than 10.x
Uninstall the Node 12.x from your machine
Download and Install Node 10.x
Restart the console/editor (not required for all and may work without this step)

Related

error installing cypress on windows 64 with npm

I'm seeing an error when attempting to install the latest cypress on my Windows 10 machine. I was using cypress 8.7 just fine. I deleted node_modules and package-lock.json and removed "cypress": "^8.7.0", from package.json.
Now installing cypress (9.1) I see this error:
npm install --save-dev cypress
npm ERR! Error: Cannot find module 'har-validator'
I see the same error when trying to use the old version too
npm install --save-dev cypress#8.7.0
System info from powershell:
node -v
> v16.8.0
npm -v
> 7.21.0
UPDATE:
My friend is able to install with dependency 8.7.0 in package.json, on OSX with nodejs 14.16.0.
This works today (2021-11-26) for me
npm install --save-dev cypress#8.7.0
There is a Bug in #cypress/request.
Take a look at https://github.com/cypress-io/request/pull/15
EDIT: There is a PR from one of the devs. https://github.com/cypress-io/request/pull/16
Looks like Cypress issue with latest versions. we have this problem for v8.7.0 today. "npm install har-validator" manually installed the missing har-validator module, that helped.

Unable to install 'node-red-contrib-tf-model' using NPM on windows10x64

I followed the tutorials below for the installation of the tensorflow model:
https://flows.nodered.org/node/node-red-contrib-tf-model
https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md
Steps taken:
I first installed the #tensorflow/tfjs-node inside Node-RED directly by running the following code:
C:\Users\username\.node-red\node_modules> npm install #tensorflow/tfjs-node#1.4.0
Ran npm install under C:\Users\username\.node-red\node_modules\#tensorflow\tfjs-node:
C:\Users\username\.node-red\node_modules\#tensorflow\tfjs-node> npm install
Finally ran npm install node-red-contrib-tf-model in the same directory:
C:\Users\username\.node-red\node_modules\#tensorflow\tfjs-node> npm install node-red-contrib-tf-model
Error that occured:
npm WARN node-red-contrib-tf-model#0.1.11 requires a peer of #tensorflow/tfjs-node#^1.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN #tensorflow/tfjs-node#1.4.0 No license field.
I have installed the correct tfjs-node version, and so why does this error occur?
Edit: Tried installing the module straight from Node-RED itself and got the following
ERROR:The specified module could not be found.
C:\Users\username\.node-red\node_modules\#tensorflow\tfjs-node\lib\napi-v6\tfjs_binding.node
When I checked the above directory it turns out that I do have the 'tfjs_binding.node'.
What am I doing wrong here? Can someone please help me out.

'npm ERR! 404 Not Found: async-validator' while installing Element-UI

I keep getting
npm ERR! 404 Not Found: async-validator#~1.8.1
while trying to install Element-UI. Tried installing async-validator through npm and got the same error, tried reinstalling Node, ...
node v10.2.1
npm 6.1.0
Any help is appreciated
EDIT:
I followed the first link MantasPtr commented and was able to install async validator like so:
npm install https://github.com/yiminghe/async-validator/archive/1.8.2.tar.gz
Do not specify the version code while installing a new version of library using npm. It might download the order version of that library
Specify the library name as it is to install the latest version or specify #latest
npm install async-validator --save
or
npm install async-validator#latest --save
May be, this is a temporary solution:
npm install https://github.com/yiminghe/async-validator/archive/1.8.1.tar.gz
if you try to load npm install https://github.com/yiminghe/async-validator/archive/1.8.2.tar.gz in a browser, you will see {"error":"Not found"} as a result.
but https://github.com/yiminghe/async-validator/archive/1.8.1.tar.gz will be found. So I work with an older version and will look for an update later.

Bigcommerce node version error after reinstall stencil-cli

The stencil gives an error info when I run $ stencil start today.
Error info: You are using an outdated version of stencil-cli, Please run $ npm install -g bigcommerce/stencil-cli.
I reinstall the Stencil-CLI and run
$ npm install and $stencil start
You are running an older version of node. Please upgrade to >= 4.0.0
What should I do to resolve this problem? Can anyone help?
upgrade your node version to 4.0.0 or higher and then run npm install for stencil CLI
Check out nvm-windows installation instructions. You should then use nvm-windows to update your node to 4.X+
I had to run nvm use 4.
Now using node v4.7.3 (npm v2.15.11)
Once I ran this and tried stencil start, it worked for me.

npm generator-ionic Install Requires yo#>=1.0.0

I'm trying to install generator-ionic, and I get the following fatal error:
EPEERINVALID generator-ionic#0.7.3 requires a peer of yo#>=1.0.0 but none was installed
I'm using node 0.12.17, npm 3.3.6, and yo 1.4.7, so I do not understand what isn't satisfied.
#chrysanhy I think I found the issue. I just downgraded my npm version to 2.7.4 and when I ran the command npm install generator-ionic-g the following message appeared:
npm WARN peerDependencies The peer dependency yo#>=1.0.0 included from generator-ionic will no longer be automatically installed to fulfill the peerDependency in npm 3+. Your application will need to depend on it explicitly.
Now the ionic-generator is working fine on my machine. Hope this helps you and everyone who is facing the same problem.