Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install node-sass

I am attempting to install node-sass and it just won't let me. I have tried updating npm.

I put this in:

sudo npm install -g node-sass

and i get this (starting one line before the error):

gyp verb build dir attempting to create "build" dir: 
/Users/matt/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir 
'/Users/matt/node_modules/node-sass/build'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" 
"/Users/matt/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "- 
-verbose" "--libsass_ext=" "--libsass_cflags=" "-- 
libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/matt/node_modules/node-sass
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN enoent ENOENT: no such file or directory, open                     
'/Users/matt/package.json'
npm WARN [email protected] requires a peer of ajv@^6.0.0 but         
none is installed. You must install peer dependencies yourself.
npm WARN matt No description
npm WARN matt No repository field.
npm WARN matt No README data
npm WARN matt No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     /Users/matt/.npm/_logs/2018-08-02T16_18_15_228Z- 
debug.log
like image 719
Matt Wright Avatar asked Aug 02 '18 16:08

Matt Wright


People also ask

Why is node Sass not working?

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.

How install Node JS Sass?

Step 1: To install SASS, first make sure that node and npm are already installed in the system. If not, then install them using the instructions given below. First, download the latest version of a node in the system and install it. Now go to command prompt and address the folder where you want to install SASS.

Is node Sass deprecated?

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.


Video Answer


1 Answers

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

This must fix the problem

like image 113
deepakssn Avatar answered Nov 15 '22 23:11

deepakssn