Andy Nguyen
Andy Nguyen

Reputation: 461

Cannot find module 'gulp-sass'

Hi I am trying to run gulp and every time i get this Error.

10:15:04 portfolio$~gulp
module.js:549
    throw err;
    ^

Error: Cannot find module 'gulp-sass'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/andynguyen/Desktop/Portfolio/gulpfile.js:3:12)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

I have tried npm install, sudo npm install --save gulp-sass and sudo npm install -g gulp-sass. When I try to globally install the file I get

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/andynguyen/Desktop/Portfolio/node_modules/node-sass/build'
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/andynguyen/Desktop/Portfolio/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/andynguyen/Desktop/Portfolio/node_modules/node-sass
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Is my node version to recent maybe?

Upvotes: 1

Views: 5957

Answers (1)

Raunaque Zamir
Raunaque Zamir

Reputation: 96

Give Permission to your parent folder containing gulp file. open terminal: sudo chmod -R 0777 [file path] Then install gulp-sass.

If not resolved, It may be compatible issue. Delete your package-lock.json file, also remove gulp-sass from package.json, and then install gulp-sass.

Upvotes: 3

Related Questions