I am using the below mentioned configuration
npm - 6.1.0
node - 8.11.3
when i am trying to execute the command for npm install, getting an error,
`sudo npm i node-sass
[email protected] install /Users/prashant/Project_Management/node_modules/node-sass
node scripts/install.js
Unable to save binary /Users/prashant/Project_Management/node_modules/node-sass/vendor/darwin-x64-57 : { Error: EACCES: permission denied, mkdir '/Users/prashant/Project_Management/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/Users/prashant/Project_Management/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/prashant/Project_Management/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/prashant/Project_Management/node_modules/node-sass/scripts/install.js:114:11)
at Object.
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)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/Users/prashant/Project_Management/node_modules/node-sass/vendor' }
[email protected] postinstall /Users/prashant/Project_Management/node_modules/node-sass
node scripts/build.js
Building: /usr/local/bin/node /Users/prashant/Project_Management/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/Users/prashant/Project_Management/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/prashant/Project_Management/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/prashant/Project_Management/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/prashant/Project_Management/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/prashant/Project_Management/node_modules/which/which.js:89:16
gyp verb which failed at /Users/prashant/Project_Management/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/prashant/Project_Management/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb which failed python2 { Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/prashant/Project_Management/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/prashant/Project_Management/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/prashant/Project_Management/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/prashant/Project_Management/node_modules/which/which.js:89:16
gyp verb which failed at /Users/prashant/Project_Management/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/prashant/Project_Management/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb which failed stack: 'Error: not found: python2\n at getNotFoundError (/Users/prashant/Project_Management/node_modules/which/which.js:13:12)\n at F (/Users/prashant/Project_Management/node_modules/which/which.js:68:19)\n at E (/Users/prashant/Project_Management/node_modules/which/which.js:80:29)\n at /Users/prashant/Project_Management/node_modules/which/which.js:89:16\n at /Users/prashant/Project_Management/node_modules/isexe/index.js:42:5\n at /Users/prashant/Project_Management/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb which failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb which succeeded python /usr/bin/python
gyp verb check python version /usr/bin/python -c "import platform; print(platform.python_version());" returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.11.3
gyp verb command install [ '8.11.3' ]
gyp verb install input version string "8.11.3"
gyp verb install installing version: 8.11.3
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.11.3
gyp verb build dir attempting to create "build" dir: /Users/prashant/Project_Management/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/prashant/Project_Management/node_modules/node-sass/build'
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/prashant/Project_Management/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/prashant/Project_Management/node_modules/node-sass
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN @agm/[email protected] requires a peer of @angular/common@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @agm/[email protected] requires a peer of @angular/core@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
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.
`
Don't use sudo, or follow https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#linux if you need to
Most helpful comment
Don't use
sudo, or follow https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#linux if you need to