node-sass: Can not install node-sass - ERR! Failed at the node-sass@4.5.3 postinstall script 'node scripts/build.js'.

I have an error when i run npm install node-sass, i have already the last versions of node and npm (LTS) and previously already installed npm install -g windows-build-tools

Please, i need your help i can not figure out what is the issue?, and how to solved.

This is my platform:

  • NPM version (npm -v): 3.10.10
  • Node version (node -v): 6.10.3
  • Node Process (node -p process.versions):
{ http_parser: '2.7.0',
  node: '6.10.3',
  v8: '5.1.281.101',
  uv: '1.9.1',
  zlib: '1.2.11',
  ares: '1.10.1-DEV',
  icu: '58.2',
  modules: '48',
  openssl: '1.0.2k' }
  • Node Platform (node -p process.platform): win32
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p "require('node-sass').info"):
  • npm node-sass versions (npm ls node-sass):

Error message from npm install node-sass

> node-sass@4.5.3 postinstall C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass
> node scripts/build.js
 
Building: C:\Program Files\nodejs\node.exe C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\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 [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\carlosm\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gy
p.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 node-gyp@3.6.1
gyp info using node@6.10.3 | win32 | 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 "C:\Python27\python.exe" in the PATH
gyp verb `which` succeeded C:\Python27\python.exe C:\Python27\python.exe
gyp verb check python version `C:\Python27\python.exe -c "import platform; print(platform.python_version());"` returned:
"2.7.13\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.10.3
gyp verb command install [ '6.10.3' ]
gyp verb install input version string "6.10.3"
gyp verb install installing version: 6.10.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" 0
gyp verb needs "installVersion" 9
gyp verb install version is no good; reinstalling
gyp verb ensuring nodedir is created C:\Users\carlosm\.node-gyp\6.10.3
gyp http GET https://nodejs.org/download/release/v6.10.3/node-v6.10.3-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.10.3' ]
gyp verb remove using node-gyp dir: C:\Users\carlosm\.node-gyp
gyp verb remove removing target version: 6.10.3
gyp verb remove removing development files for version: 6.10.3
gyp ERR! configure error
gyp ERR! stack Error: ENOENT: no such file or directory, open 'D:\Dev\WEB\test-sass-app\undefined'
gyp ERR! stack     at Error (native)
gyp ERR! stack     at Object.fs.openSync (fs.js:641:18)
gyp ERR! stack     at Object.fs.readFileSync (fs.js:509:33)
gyp ERR! stack     at readCAFile (C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\
install.js:466:15)
gyp ERR! stack     at download (C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\in
stall.js:438:22)
gyp ERR! stack     at C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\install.js:1
85:19
gyp ERR! stack     at C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\mkdirp\index.js:48:26
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\carlosm\\AppData\\Roaming\\npm\\node_modules\\node-sa
ss\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldfl
ags=" "--libsass_library="
gyp ERR! cwd C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
Build failed with error code: 1
npm verb lifecycle node-sass@4.5.3~postinstall: unsafe-perm in lifecycle true
npm verb lifecycle node-sass@4.5.3~postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users
\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\.bin;C:\Users\carlosm\AppData\Roaming\npm\node_modules\
.bin;%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\Python27\;C:\Python27\Scripts;C:\apps\oracle\product\11.2.0\client
_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\W
indowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Windows Kits\8.1
\Windows Performance Toolkit\;$PATH;D:\JAVA\apache-tomcat-8.0.9/bin;C:\Program Files (x86)\VSCode-win32-1.11.2\;C:\Pytho
n27;C:\Users\carlosm\AppData\Roaming\npm
npm verb lifecycle node-sass@4.5.3~postinstall: CWD: C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass
npm info lifecycle node-sass@4.5.3~postinstall: Failed to exec postinstall script
npm verb unlock done using C:\Users\carlosm\AppData\Roaming\npm-cache\_locks\staging-fce30b53446447ec.lock for C:\Users\
carlosm\AppData\Roaming\npm\node_modules\.staging
npm verb stack Error: node-sass@4.5.3 postinstall: `node scripts/build.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at EventEmitter.emit (events.js:191:7)
npm verb stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at ChildProcess.emit (events.js:191:7)
npm verb stack     at maybeClose (internal/child_process.js:886:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm verb pkgid node-sass@4.5.3
npm verb cwd D:\Dev\WEB\MetricsMonitorClient\dashboard-sass
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "ins
tall" "-g" "node-sass" "--verbose"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
 
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]
 
npm ERR! Please include the following file with any support request:
npm ERR!     D:\Dev\WEB\MetricsMonitorClient\dashboard-sass\npm-debug.log

I follow the template, please do not close the issue, i have already three day without solution to this issue

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 22 (3 by maintainers)

Most upvoted comments

I solved this problem by doing yarn add node-sass

Solved this by force installing node-sass locally: npm install -f node-sass

I was pretty sure I knew what I was doing…

Solved install sudo apt-get install gcc g++ build-essential Ubuntu 16.04

npm install node-sass@latest

On 28 Dec. 2017 9:00 pm, “Biranchi” notifications@github.com wrote:

None of the above things worked… pissed off with node v9.3.0 (sucks)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sass/node-sass/issues/1980#issuecomment-354262687, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjZWAwoz3HoOOa_-h3-W7CWSw5aFac5ks5tE2a9gaJpZM4NodCh .

None of the above things worked… pissed off with node v9.3.0 (sucks)

I see this in the log

Skipping downloading binaries on CI builds

Which suggests you’re using a special environment variables to change node sass’ install behaviour.

On 28 May 2017 8:07 pm, “Carlos Mantilla” notifications@github.com wrote:

Here is my npm config, just in case:

PS D:\Dev\WEB\MetricsMonitorClient\dashboard-ng> npm config list; cli configs user-agent = “npm/3.10.10 node/v6.10.3 win32 x64” ; userconfig C:\Users\carlosm.npmrc ca = null cafile = “D:\Dev\WEB\test-sass-app\undefined” catfile = “D:\temp\base.cer” npm_config_resume = false phyton = “C:\Python27\python.exe” python = “C:\Python27\python.exe” registry = “https://registry.npmjs.org/” registy = “http://registry.npmjs.org/” strict-ssl = false ; globalconfig C:\Users\carlosm\AppData\Roaming\npm\etc\npmrc msvs_version = “2015” ; builtin config undefined prefix = “C:\Users\carlosm\AppData\Roaming\npm” ; node bin location = C:\Program Files\nodejs\node.exe; cwd = D:\Dev\WEB\MetricsMonitorClient\dashboard-ng; HOME = C:\Users\carlosm; “npm config ls -l” to show all defaults.

PS D:\Dev\WEB\MetricsMonitorClient\dashboard-ng> npm config ls -l; cli configs long = true user-agent = “npm/3.10.10 node/v6.10.3 win32 x64” ; userconfig C:\Users\carlosm.npmrc ca = null cafile = “D:\Dev\WEB\test-sass-app\undefined” catfile = “D:\temp\base.cer” npm_config_resume = false phyton = “C:\Python27\python.exe” python = “C:\Python27\python.exe” registry = “https://registry.npmjs.org/” registy = “http://registry.npmjs.org/” strict-ssl = false ; globalconfig C:\Users\carlosm\AppData\Roaming\npm\etc\npmrc msvs_version = “2015”; python = “C:\Users\carlosm\.windows-build-tools\python27\python.exe” (overridden) ; builtin config undefined prefix = “C:\Users\carlosm\AppData\Roaming\npm” ; default values access = null also = null always-auth = false bin-links = true browser = null ca = null cache = “C:\Users\carlosm\AppData\Roaming\npm-cache” cache-lock-retries = 10 cache-lock-stale = 60000 cache-lock-wait = 10000 cache-max = null cache-min = 10; cafile = undefined (overridden) cert = null color = true depth = null description = true dev = false dry-run = false editor = “notepad.exe” engine-strict = false fetch-retries = 2 fetch-retry-factor = 10 fetch-retry-maxtimeout = 60000 fetch-retry-mintimeout = 10000 force = false git = “git” git-tag-version = true global = false global-style = false globalconfig = “C:\Users\carlosm\AppData\Roaming\npm\etc\npmrc” globalignorefile = “C:\Users\carlosm\AppData\Roaming\npm\etc\npmignore” group = 0 heading = “npm” https-proxy = null if-present = false ignore-scripts = false init-author-email = “” init-author-name = “” init-author-url = “” init-license = “ISC” init-module = “C:\Users\carlosm\.npm-init.js” init-version = “1.0.0” json = false key = null legacy-bundling = false link = false local-address = undefined loglevel = “warn”; long = false (overridden) maxsockets = 50 message = “%s” node-version = “6.10.3” npat = false onload-script = null only = null optional = true parseable = false; prefix = “C:\Program Files\nodejs” (overridden) production = false progress = true proprietary-attribs = true proxy = null rebuild-bundle = true registry = “https://registry.npmjs.org/” rollback = true save = false save-bundle = false save-dev = false save-exact = false save-optional = false save-prefix = “^” scope = “” searchexclude = null searchopts = “” searchsort = “name” shell = “C:\Windows\system32\cmd.exe” shrinkwrap = true sign-git-tag = false; strict-ssl = true (overridden) tag = “latest” tag-version-prefix = “v” tmp = "C:\Users\carlosm\AppData\Local\Temp"umask = 0 unicode = false unsafe-perm = true usage = false user = 0; user-agent = “npm/{npm-version} node/{node-version} {platform} {arch}” (overridden) userconfig = “C:\Users\carlosm\.npmrc” version = false versions = false viewer = “browser”

PS D:\Dev\WEB\MetricsMonitorClient\dashboard-ng>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sass/node-sass/issues/1980#issuecomment-304504513, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjZWBQO2yqgo8Ws1E5teD1R27QGsDLbks5r-UdZgaJpZM4NodCh .

I fixed the error below downgrading from node 9.x to node 8.x

> node-sass@4.5.3 install /home/my-user/my-project/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-59_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-59_binding.node": 

HTTP error 404 Not Found

Hope this helps someone.

Please provide the full error log. You most likely encountered a network error during install.

On 28 May 2017 5:56 am, “Carlos Mantilla” notifications@github.com wrote:

I have an error when i run npm install node-sass, i have already the last versions of node and npm (LTS) and previously already installed npm install -g windows-build-tools

Please, i need your help i can not figure out what is the issue?, and how to solved.

This is my platform:

  • NPM version (npm -v): 3.10.10
  • Node version (node -v): 6.10.3
  • Node Process (node -p process.versions):

{ http_parser: ‘2.7.0’, node: ‘6.10.3’, v8: ‘5.1.281.101’, uv: ‘1.9.1’, zlib: ‘1.2.11’, ares: ‘1.10.1-DEV’, icu: ‘58.2’, modules: ‘48’, openssl: ‘1.0.2k’ }

  • Node Platform (node -p process.platform): win32
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p “require(‘node-sass’).info”):
  • npm node-sass versions (npm ls node-sass):

Error message from npm install node-sass

node-sass@4.5.3 postinstall C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\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 [ ‘C:\Program Files\nodejs\node.exe’, gyp verb cli ‘C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\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 node-gyp@3.6.1 gyp info using node@6.10.3 | win32 | 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 “C:\Python27\python.exe” in the PATH gyp verb which succeeded C:\Python27\python.exe C:\Python27\python.exe gyp verb check python version C:\Python27\python.exe -c "import platform; print(platform.python_version());" returned:“2.7.13\r\n” gyp verb get node dir no --target version specified, falling back to host node version: 6.10.3 gyp verb command install [ ‘6.10.3’ ] gyp verb install input version string “6.10.3” gyp verb install installing version: 6.10.3 gyp verb install --ensure was passed, so won’t reinstall if already installedgyp verb install version is already installed, need to check "installVersion"gyp verb got “installVersion” 0gyp verb needs “installVersion” 9gyp verb install version is no good; reinstallinggyp verb ensuring nodedir is created C:\Users\carlosm.node-gyp\6.10.3gyp http GET https://nodejs.org/download/release/v6.10.3/node-v6.10.3-headers.tar.gzgyp WARN install got an error, rolling back installgyp verb command remove [ ‘6.10.3’ ]gyp verb remove using node-gyp dir: C:\Users\carlosm.node-gypgyp verb remove removing target version: 6.10.3gyp verb remove removing development files for version: 6.10.3gyp ERR! configure errorgyp ERR! stack Error: ENOENT: no such file or directory, open 'D:\Dev\WEB\test-sass-app\undefined’gyp ERR! stack at Error (native)gyp ERR! stack at Object.fs.openSync (fs.js:641:18)gyp ERR! stack at Object.fs.readFileSync (fs.js:509:33)gyp ERR! stack at readCAFile (C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\install.js:466:15)gyp ERR! stack at download (C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\install.js:438:22)gyp ERR! stack at C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\install.js:185:19gyp ERR! stack at C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\mkdirp\index.js:48:26gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)gyp ERR! System Windows_NT 6.1.7601gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” "–libsass_library="gyp ERR! cwd C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sassgyp ERR! node -v v6.10.3gyp ERR! node-gyp -v v3.6.1gyp ERR! not okBuild failed with error code: 1npm verb lifecycle node-sass@4.5.3~postinstall: unsafe-perm in lifecycle truenpm verb lifecycle node-sass@4.5.3~postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sass\node_modules.bin;C:\Users\carlosm\AppData\Roaming\npm\node_modules.bin;%SystemRoot%\system32\WindowsPowerShell\v1.0;C:\Python27;C:\Python27\Scripts;C:\apps\oracle\product\11.2.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;$PATH;D:\JAVA\apache-tomcat-8.0.9/bin;C:\Program Files (x86)\VSCode-win32-1.11.2;C:\Python27;C:\Users\carlosm\AppData\Roaming\npmnpm verb lifecycle node-sass@4.5.3~postinstall: CWD: C:\Users\carlosm\AppData\Roaming\npm\node_modules\node-sassnpm info lifecycle node-sass@4.5.3~postinstall: Failed to exec postinstall scriptnpm verb unlock done using C:\Users\carlosm\AppData\Roaming\npm-cache_locks\staging-fce30b53446447ec.lock for C:\Users\carlosm\AppData\Roaming\npm\node_modules.stagingnpm verb stack Error: node-sass@4.5.3 postinstall: node scripts/build.jsnpm verb stack Exit status 1npm verb stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)npm verb stack at emitTwo (events.js:106:13)npm verb stack at EventEmitter.emit (events.js:191:7)npm verb stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)npm verb stack at emitTwo (events.js:106:13)npm verb stack at ChildProcess.emit (events.js:191:7)npm verb stack at maybeClose (internal/child_process.js:886:16)npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)npm verb pkgid node-sass@4.5.3npm verb cwd D:\Dev\WEB\MetricsMonitorClient\dashboard-sassnpm ERR! Windows_NT 6.1.7601npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “-g” “node-sass” "–verbose"npm ERR! node v6.10.3npm ERR! npm v3.10.10npm ERR! code ELIFECYCLE npm ERR! node-sass@4.5.3 postinstall: node scripts/build.jsnpm ERR! Exit status 1npm ERR!npm ERR! Failed at the node-sass@4.5.3 postinstall script ‘node scripts/build.js’.npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! If you do, this is most likely a problem with the node-sass package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR! node scripts/build.jsnpm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs node-sassnpm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above. npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support request: npm ERR! D:\Dev\WEB\MetricsMonitorClient\dashboard-sass\npm-debug.log

I follow the template, please do not close the issue, i have already three day without solution to this issue

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sass/node-sass/issues/1980, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjZWINoH8CO26ROb10GCz8O02qIONVUks5r-H_qgaJpZM4NodCh .