node-sass icon indicating copy to clipboard operation
node-sass copied to clipboard

npm install node-sass fails: Binary has a problem: Error: \\?\D:\temp1\node_modules\node-sass\vendor\win32-x6 4-57\binding.node is not a valid Win32 application.

Open pabrams opened this issue 8 years ago • 6 comments

No doubt this is not really a bug, but I can't figure out what I'm doing wrong.

I am running Node v8.11.2 with node-sass 4.9.1

The node-sass/releases page says that my environment (Windows 10 x64 with Node 8) is supported in node-sass 4.9.1

**Here is the output of npm install -ddd node-sass > npm.log 2> npm.err: ** npm.log npm.err.log

  • NPM version (npm -v): 5.6.0

  • Node version (node -v): 8.11.2

  • Node Process (node -p process.versions): D:\temp1>node -p process.versions { http_parser: '2.8.0', node: '8.11.2', v8: '6.2.414.54', uv: '1.19.1', zlib: '1.2.11', ares: '1.10.1-DEV', modules: '57', nghttp2: '1.29.0', napi: '3', openssl: '1.0.2o', icu: '60.1', unicode: '10.0', cldr: '32.0', tz: '2017c' }

  • Node Platform (node -p process.platform): win32

  • Node architecture (node -p process.arch): x64

  • node-sass version (node -p "require('node-sass').info"): D:\temp1>node -p "require('node-sass').info" module.js:549 throw err; ^ Error: Cannot find module 'node-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 [eval]:1:1 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at Object.runInThisContext (vm.js:139:38) at Object. ([eval]-wrapper:6:22) at Module._compile (module.js:652:30) at evalScript (bootstrap_node.js:466:27)

  • npm node-sass versions (npm ls node-sass): D:\temp1>npm ls node-sass D:\temp1 `-- (empty)

pabrams avatar Jul 05 '18 18:07 pabrams

Looks like the binary didn't download properly.

$ npm cache clear
$ npm rebuild node-sass

xzyfer avatar Jul 06 '18 02:07 xzyfer

Those commands don't throw any errors, but they don't install node-sass either (the output of the last two commands in my original post is the same as before). If I run npm install node-sass again, I get the same errors as before.

I understand this is probably a proxy issue, but I don't have this problem with other packages, so I'm not sure what proxy configuration I'm missing.

pabrams avatar Jul 06 '18 14:07 pabrams

It looks like our proxy error message got copied into the binding file, so that was the reason for the "not a valid Win32 application"

nschonni avatar Jul 06 '18 15:07 nschonni

How were you to resolve this issue? @nschonni

Singhd-lazard avatar Apr 28 '20 15:04 Singhd-lazard

I just updated my node installation on windows 10 and now Im getting this too. @pabrams @nschonni How were you able to resolve this? Ive tried every suggestion Ive found on google with no luck yet.

davidlsharp1 avatar Feb 15 '21 03:02 davidlsharp1

In my case, I'd forgotten to update node, or messed it up, which is easy to do.
In your case, @davidlsharp1, maybe you just need to clear your cache.

pabrams avatar Feb 17 '21 21:02 pabrams