Gulp-sass: Failed at the [email protected] postinstall script.

Created on 25 Jan 2018  ยท  22Comments  ยท  Source: dlmanning/gulp-sass

โžœ  20th-century git:(master) โœ— node -v && npm -v
v8.9.4
5.6.0
โžœ  20th-century git:(master) โœ— sudo npm i gulp-sass -ES

> [email protected] install /Users/nikbelikov/Documents/20th-century/node_modules/node-sass
> node scripts/install.js

Unable to save binary /Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor/darwin-x64-57 : { Error: EACCES: permission denied, mkdir '/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:885:18)
    at sync (/Users/nikbelikov/Documents/20th-century/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/Users/nikbelikov/Documents/20th-century/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/scripts/install.js:111:11)
    at Object.<anonymous> (/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/scripts/install.js:154:1)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor' }

> [email protected] postinstall /Users/nikbelikov/Documents/20th-century/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /Users/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:89:16
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:89:16
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/node_modules/which/which.js:13:12)\n    at F (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:68:19)\n    at E (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:80:29)\n    at /Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:89:16\n    at /Users/nikbelikov/Documents/20th-century/node_modules/isexe/index.js:42:5\n    at /Users/nikbelikov/Documents/20th-century/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.9.4
gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
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.9.4
gyp verb build dir attempting to create "build" dir: /Users/nikbelikov/Documents/20th-century/node_modules/node-sass/build
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/build'
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/usr/local/bin/node" "/Users/nikbelikov/Documents/20th-century/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/nikbelikov/Documents/20th-century/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN 20th-century@ No repository 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/nikbelikov/.npm/_logs/2018-01-25T13_04_57_833Z-debug.log
โžœ  20th-century git:(master) โœ— sudo npm r gulp-sass -ES
npm WARN 20th-century@ No repository field.

removed 2 packages in 7.124s
โžœ  20th-century git:(master) โœ— sudo npm i gulp-sass -ES

> [email protected] install /Users/nikbelikov/Documents/20th-century/node_modules/node-sass
> node scripts/install.js

Unable to save binary /Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor/darwin-x64-57 : { Error: EACCES: permission denied, mkdir '/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:885:18)
    at sync (/Users/nikbelikov/Documents/20th-century/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/Users/nikbelikov/Documents/20th-century/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/scripts/install.js:111:11)
    at Object.<anonymous> (/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/scripts/install.js:154:1)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor' }

> [email protected] postinstall /Users/nikbelikov/Documents/20th-century/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /Users/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:89:16
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:89:16
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /Users/nikbelikov/Documents/20th-century/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/nikbelikov/Documents/20th-century/node_modules/which/which.js:13:12)\n    at F (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:68:19)\n    at E (/Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:80:29)\n    at /Users/nikbelikov/Documents/20th-century/node_modules/which/which.js:89:16\n    at /Users/nikbelikov/Documents/20th-century/node_modules/isexe/index.js:42:5\n    at /Users/nikbelikov/Documents/20th-century/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.9.4
gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
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.9.4
gyp verb build dir attempting to create "build" dir: /Users/nikbelikov/Documents/20th-century/node_modules/node-sass/build
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/build'
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/usr/local/bin/node" "/Users/nikbelikov/Documents/20th-century/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/nikbelikov/Documents/20th-century/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN 20th-century@ No repository 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/nikbelikov/.npm/_logs/2018-01-25T13_07_31_815Z-debug.log
โžœ  20th-century git:(master) โœ— 

Most helpful comment

@krayushfk I use this flag --unsafe-perm=true Hope it will help you too.

sudo npm i gulp-sass -ES --unsafe-perm=true

All 22 comments

Any update on this? Did you get it resolved?

Nope :|

The error message states this is a permission issue. There's nothing to be
done in gulp-sass.

Unable to save binary
/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor/darwin-x64-57
: { Error: EACCES: permission denied, mkdir
'/Users/nikbelikov/Documents/20th-century/node_modules/node-sass/vendor'

On 30 Jan. 2018 5:44 pm, "Nikolay" notifications@github.com wrote:

Nope :|

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/dlmanning/gulp-sass/issues/652#issuecomment-361492815,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjZWPuofDQjPVOCluXswQB35tL6meTGks5tPrplgaJpZM4Rs0uV
.

@krayushfk I use this flag --unsafe-perm=true Hope it will help you too.

sudo npm i gulp-sass -ES --unsafe-perm=true

@xzyfer: Little help needed here man!
A lot of devs are facing this issue.
Can you please help!

@nikbelikov: Thanks for the reply but that didn't work as well

Binary found at /var/lib/jenkins/jobs/capacity-planner-ui/workspace/tmp/src/github.com/Flipkart/capacity-planner-ui/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Segmentation fault
npm ERR! code ELIFECYCLE
npm ERR! errno 139
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 139

This is a different issue. Please open an issue with node-sass with the
sass code that produced the default.

The original issue was a permission issue. Not all installation issues are
the same issue.

On 2 Feb. 2018 5:27 pm, "Ayush Walia" notifications@github.com wrote:

@nikbelikov https://github.com/nikbelikov: Thanks for the reply but
that didn't work as well

Binary found at /var/lib/jenkins/jobs/capacity-planner-ui/workspace/tmp/src/github.com/Flipkart/capacity-planner-ui/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Segmentation fault
npm ERR! code ELIFECYCLE
npm ERR! errno 139
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 139

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dlmanning/gulp-sass/issues/652#issuecomment-362498466,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjZWKRs1N79k6kdkkaSFx-nCBz1Nklrks5tQqq7gaJpZM4Rs0uV
.

getting this:

Binary has a problem: [Error: .../node_modules/node-sass/vendor/linux-x64-46/binding.node: ELF file OS ABI invalid]

2018-02-06 17:22:55 gobuilds.Compile : npm ERR! [email protected] postinstall: node scripts/build.js
2018-02-06 17:22:55 gobuilds.Compile : npm ERR! Exit status 1

@kodemasta see https://github.com/sass/node-sass/issues/2159 for discussion on this issue

@nikbelikov In my case, also I had to delete the package-lock.json and work normally.

npm update node-sass@late will do everything you need.

I also had to delete the package-lock.json and it's work well. Thanks

Had the same issue a few seconds ago. Deleting package-lock.json helped me! Thanks a lot, people!

@nikbelikov Thanks. It works for me!

$ sudo npm install node-sass --save-dev --unsafe-perm=true

@kwoncheol You my man.It works with the following command guys.
sudo rm -rf node_modules && npm rebuild node-sass && npm i
Thanks a lot @kwoncheol

Thanks guys and @akshayseth, removing package-lock.json and then running npm rebuild node-sass && npm i worked for me...

Also: If you're using yarn remove yarn.lock

Reason: the node-sass folder you downloaded when npm install is empty

In 'C:\Users\Administrator\AppData\Roamingnpm-cachenode-sass\4.7.2\
Solution: download it by yourself with npm I node-sass

In "C:\Users\Administrator\AppData\Roamingnpm-cachenode-sass\4.7.2\ '", there will be a file win32-x64-57_binding , Copy this file under 4.7.2 and then re-install npm install

Deleting package.json and run again npm install solve my issue. Thank SarahPhuong

@nikbelikov Thank you.

never run npm command with sudo
change the ownership of your folder using sudo chown -R username:username /Users/nikbelikov/Documents/20th-century/

"to know your username do 'whoami'

then do npm install whatever you want to

@nikbelikov Thanks. It works for me!

$ sudo npm install node-sass --save-dev --unsafe-perm=true

Thank-you so much! It solved my problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesVanWaza picture JamesVanWaza  ยท  4Comments

demurgos picture demurgos  ยท  5Comments

simon-tma picture simon-tma  ยท  4Comments

simonua picture simonua  ยท  5Comments

mrgnou picture mrgnou  ยท  6Comments