ERROR in Cannot find module 'node-sass'

萝らか妹 提交于 2019-11-28 03:52:41
Alex Onozor

Here's the solution:

sudo npm install --save-dev  --unsafe-perm node-sass

Enjoy!

If thist doesn't work try to install from a mirror

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

kedar kokil
  1. This error is for node-sass is not present ... to solve this just you want to run following command

npm install node-sass

PENG ZHU

Run:

npm rebuild node-sass --force              

and it'll work fine.

Doing npm uninstall node-sass and then npm i node-sass, not worked for me.

Solution worked for me is npm install --save-dev node-sass.

Happy Coding..

It worked for me...

sudo npm rebuild node-sass --force

There is an issue with downloading npm dependencies due to network which you have. try to download the npm dependencies in open network . you won't get any issue. i am also faced this similar issue and resolved finally.

use below commands: npm install (it will download all depedencies) npm start to start the angular application

One of the cases is the post-install process fails. Right after node-sass is installed, the post-install script will be executed. It requires Python and a C++ builder for that process. The log 'gyp: No Xcode or CLT version detected!' maybe because it couldn't find any C++ builder. So try installing Python and any C++ builder then put their directories in environment variables so that npm can find them. (I come from Windows)

npm install node-sass will do the job in most of the cases, as it will add missing sass npm dependency module doesn't exist or it will overwrite previous crashed version.

For Mac Users use sudo in front of above commands.

On Windows machines npm rebuild node-sass --force may not work for some users because it's essentially saying, "please force npm to rebuild the sass node module for me". It will not work because that module doesn't exist.

Whenever you did npm install to the initial installation, the sass module did not get installed, which is why this problem occurs.

I ran into this error while I was using Microsoft Visual Studio Code's integrated git terminal. For some weird reason VS code was not allowing me to install 'node-sass'. Then I used 'Git Bash' (which was installed with git) and ran the following command: npm install node-sass It worked for me. I don't know why & how it worked. If anyone has any explanation please let me know.

davecar21

I checked the Node version in my local machine, which is v10.11.0.

Then when I checked my development machine, where the error occurred, it had Node version V.10.8.0.

Upgrading Node to v10.11.0 in my development machine fixed the issue.

Hope this helps.

I had a similar issue when I tried to run a project. First i uninstalled the current version

npm uninstall node-sass

Then i reinstalled to the latest version with

npm install node-sass
zardilior

node-sass is not being installed and it can be one of many reasons

You have not installed it

npm install node-sass --save-dev

You are having a permissions error

sudo npm install --save-dev  --unsafe-perm node-sass

You had a memory issue because it tried to make it (build from c code in your platform),this applies to some platforms and node versions

node --max_old_space_size=8000 $(which npm) install node-sass --save-dev

Your node and npm versions are not compatible,which most probably generated a failure in the build process,

In this case use n or nvm to make sure you have the same version in the new and original environment, the one where it did work, as this is usually by using different versions in different environments

If you run

npm install node-sass

and it still doesn't work remember to change permission to folder

Paras Agarwal

I have also been facing this error. None of the above methods work for me. Please follow this as it worked for me.

For Installing node-sass in Ubuntu 16 via npm :-

You can install with npm 5.2.0 Version

If you are using nvm :-

nvm install 8.2.1
nvm use 8.2.1
npm install node-sass

If you are using npm separately then upgrade or downgrade npm version to 5.2.0

npm install node-sass
Nadreak

You should try to check the log generated by npm install.

I have faced the same issues, and I found the error that python2 is not found in the path (environment variable).

After installing Python, everything worked fine.

In my case I had to also had to perform:

npm install sass-loader

To fix the problem

Upgrading to latest version of nodeJS solved my problem

I've fixed this problem by installing v10.16.10 node version.

It failed for me because I was using the latest version of node (12.7.0) I then had to explicitly install the latest version of node-sass with:

npm install node-sass@4.12.0

npm install --save-dev --unsafe-perm node-sass

This will do magic, you can use it with sudo

What fixed it for me was installing the latest version of node-sass, in this case 4.7.2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!