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)
I solved this problem by doing
yarn add node-sassSolved this by force installing node-sass locally:
npm install -f node-sassI 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)
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:
I fixed the error below downgrading from node 9.x to node 8.x
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: