Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR in ./node_modules/css-loader?

I was trying to run an angular project in windows 10. It is the same project that I am doing in Ubuntu. When I clone the repository and install all the node packages I encountered this error.

ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/scss/style.scss Module build failed: Error: ENOENT: no such file or directory, scandir 'C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\vendor' at Object.fs.readdirSync (fs.js:911:18) at Object.getInstalledBinaries (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\lib\extensions.js:124:13) at foundBinariesList (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\lib\errors.js:20:15) at foundBinaries (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\lib\errors.js:15:5) at Object.module.exports.missingBinary (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\lib\errors.js:45:5) at module.exports (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\lib\binding.js:15:30) at Object. (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\node-sass\lib\index.js:14:35) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Module.require (module.js:568:17) at require (internal/module.js:11:18) at Object. (C:\Users\Jaaayz\Documents\ad-fingerprinting\web\node_modules\sass-loader\lib\loader.js:3:14) at Module._compile (module.js:624:30) @ ./src/scss/style.scss 4:14-195 @ multi ./src/scss/style.scss

I tried googline it and do everything about it but didn't find any solution.

node -v 8.5.0

Angular CLI version 1.4.3

Appreciate if someone calp help. Thanks in advance.

like image 772
Jaaayz Avatar asked Sep 26 '17 06:09

Jaaayz


4 Answers

Run this command:

npm install --save node-sass

This does the same as above. Similarly to the answer above.

like image 36
Akin Okegbile Avatar answered Oct 31 '22 22:10

Akin Okegbile


Try this

npm install node-sass

Then

npm run start

like image 91
Fadi Abo Msalam Avatar answered Nov 01 '22 00:11

Fadi Abo Msalam


I am also facing the same problem, but I resolve.

npm install node-sass  

Above command work for me. As per your synario you can use the blow command.

Try 1

 npm install node-sass

Try 2

Remove the node_modules folder and run:

npm install

Try 3

npm rebuild node-sass

Try 4

npm install --save node-sass

For your ref you can go through this github link

like image 13
Srikrushna Avatar answered Nov 01 '22 00:11

Srikrushna


I tried both

npm rebuild node-sass

and

npm install --save node-sass

Later by seeing EACCESS, i checked the folder permission of /node_modules, which was not 777 permission

Then I gave

chmod -R 777 *

-R for recursively(setting the same permission not in the dir but also inside nested sub dir)

  • is for all files in current directory

What is file permission

To check for permission you can use

ls -l

If u don't know about it, first see here, then check the url

Every file and directory has permission of 'rwx'(read, write, execute). and if 'x' permission is not there, then you can not execute, if no 'w', you can not write into the file. if something is missing it will show in place of r/w/x with '-'. So, if 'x' permission is not there, it will show like 'rw-'

And there will be 3 categories of user Owner(who created the file/directory), Group(some people who share the same permission and user privilege), Others(general public)

So 1st letter is 'd'(if it is a directory) or '-'(if it is not a directory), followed by rwx for owner, followed by for group, followed by other

drwxrwxrwx

For example, for 'node_modules'directory I want to give permission to the owner all permission and for rest only read, then it will be

drwxr--r--

And about the number assume for 'r/w/x' it is 1 and for '-' it is 0, 777, first 7 is for the owner, followed by the group, followed by other

Let's assume the permission is rwxr-xrw-

Now 'rwx' is like '111' and its equivalent decimal is 12^2+12^1+1*2^0=7

Now 'r-x' is like '101' and its equivalent decimal is 12^2+02^1+1*2^0=5

Now 'rw-' is like '110' and its equivalent decimal is 12^2+12^1+0*2^0=6

So, it will be 756

like image 3
Satish Patro Avatar answered Nov 01 '22 00:11

Satish Patro