0

my global ng version is 1.6.1 and local ng-cli version is 1.6.1 so first warning then i got error,

ERROR in ./src/app/app.component.scss Module build failed: Error: Cannot find module 'node-sass' 

so anyone can help me ?

1
  • Can you show how are you importing it in your app.component.scss? Commented May 16, 2018 at 10:26

3 Answers 3

3

It seems that the node-sass has not been fetched on your desktop when you initiated your angular environment. This probably happened when you launched npm install -g @angular/cli.

If you are working in an enterprise context, using

  • a web proxy
  • a local repository manager (say Nexus) in which packages are first proxified then downloaded to your desktop

then you may encounter this issue.

Explanation:

node-sass uses compiled C libs that are stored in Github. Your local repository manager (a.k.a. Nexus) should not be able to handle such a dependency.

Sollution:

If you are allowed to get out of your enterprise through the proxy, then you should configure the proxy in your .npmrc file (it should not be difficult to find a tuto that explains how). Then relaunch npm install -g @angular/cli.

If you are not allowed to get out of your enterprise through the web proxy, then your only sollution is to ask your Software Factory manager to package this npm module for you, including the C lib dependency.

Note that the situation that i just describe is not uncommon with npm packages.

Sign up to request clarification or add additional context in comments.

Comments

2

Try removing the node_modules directory and re-installing the node modules.

Comments

0

Looks like you're missing node-sass in your project. Try installing it through npm i node-sass -D and rerun again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.