You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Installing on io.js 1.2 on Windows 8.1 attempts to download sass binary for node 1.3 #708
If I manually download the binary and place it in to the vendors folder, I get:
[17:49:49] Error: %1 is not a valid Win32 application.
D:\test\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-node-1.2\binding.node
at Error (native)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
at Module.require (module.js:351:17)
at require (module.js:370:17)
at Object.<anonymous> (D:\test\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:15)
at Module._compile (module.js:446:26)
at Object.Module._extensions..js (module.js:464:10)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
Interestingly, if I use pangyp to manually build a binary using Visual Studio 2013 Update 4, I also get a similiar error:
[17:48:54] Error: Module did not self-register.
at Error (native)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
at Module.require (module.js:351:17)
at require (module.js:370:17)
at Object.<anonymous> (D:\test\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:15)
at Module._compile (module.js:446:26)
at Object.Module._extensions..js (module.js:464:10)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
@F21 I have got that very same error (Error: Module did not self-register.) after using pangyp to build my own module (not node-sass). I'm using nan 1.6.2. It had been building in node 0.12.0 without a problem.
I was using node 0.10 which was working perfectly and decided to move to io.js to see if my build tools still work. Looks like I will have to move back to node.js for now.
Once again, this is mainly due to the strong names: #694. But even after that fix, this particular use case won't work for Windows.
Which use-case?
You are using iojs, but you are (unintentionally) calling it with its node.exe alias (which unfortunately is not just an alias or a symlink in Windows).
As you can see, io.js needs to be initiated with iojs prefix, instead of node (which should be just an alias, but in Windows case it is a full blown thing: .exe file!!). But this is due to (aforementioned) our wrong strong naming convention.
Now that the naming convention is fixed and we are using v8 version instead of the runtime name, will I NEVER get this issue again?
As you can see, there is no straightforward solution to this complex (?) problem. But to quickly reproduce what exactly is wrong, once you finish installing node-sass with iojs prefix, first test it with iojs:
iojs -v
# should be v1.2
iojs -p "console.log(require('node-sass').renderSync({data:'a{b:c}'}))"# should print:
{ stats:
{ entry: 'data',
start: 1424944152451,
includedFiles: [],end: 1424944152452,
duration: 1 },
css: 'a {\n b: c; }\n',
map: '{}' }
Then rename node-sass\vendor\win32-x64-iojs-1.2\binding.node to node-sass\vendor\win32-x64-node-1.2\binding.node, then try to run node-sass with node v1.2 (which packs with iojs):
node -v
# should be v1.2
node -p process.execPath
# should be the path to iojs directory and it should be node.exe (not node.cmd)# if it is node.cmd, that means you are probably using nvmw, which has the cool# workaround for it, see iojs issue I linked above for details.# To proceed with reproducing this bug, you should have a system level# io.js v1.2 installed.
node -p "console.log(require('node-sass').renderSync({data:'a{b:c}'}))"# will throw module registration exception# ^^^^^ this is the actual problem, which I am trying to describe to iojs folks
Closing this as external. The quick workaround is to use iojs prefix (instead of node) when using io.js runtime.
Alternatively, install nvmw, which has circumvented this issue by injecting node.cmd in the io.js folder. (see the aforementioned appveyor and io.js issues)
Activity
F21 commentedon Feb 26, 2015
If I manually download the binary and place it in to the
vendorsfolder, I get:Interestingly, if I use
pangypto manually build a binary using Visual Studio 2013 Update 4, I also get a similiar error:metabench commentedon Feb 26, 2015
@F21 I have got that very same error (
Error: Module did not self-register.) after using pangyp to build my own module (not node-sass). I'm using nan 1.6.2. It had been building in node 0.12.0 without a problem.F21 commentedon Feb 26, 2015
I was using
node 0.10which was working perfectly and decided to move toio.jsto see if my build tools still work. Looks like I will have to move back tonode.jsfor now.am11 commentedon Feb 26, 2015
@F21,
Once again, this is mainly due to the strong names: #694. But even after that fix, this particular use case won't work for Windows.
Which use-case?
You are using iojs, but you are (unintentionally) calling it with its node.exe alias (which unfortunately is not just an alias or a symlink in Windows).
This only applies to Windows:
First of all, Quick Solution to your problem is:
As you can see, io.js needs to be initiated with
iojsprefix, instead ofnode(which should be just an alias, but in Windows case it is a full blown thing: .exe file!!). But this is due to (aforementioned) our wrong strong naming convention.For Linux/Mac most probably yes, for Windows no! See: nodejs/node#871 and appveyor/ci#139.
As you can see, there is no straightforward solution to this complex (?) problem. But to quickly reproduce what exactly is wrong, once you finish installing node-sass with
iojsprefix, first test it with iojs:Then rename
node-sass\vendor\win32-x64-iojs-1.2\binding.nodetonode-sass\vendor\win32-x64-node-1.2\binding.node, then try to run node-sass with node v1.2 (which packs with iojs):boopathi commentedon Feb 26, 2015
I use
iojsinstead ofnodeand all my downloads will tryiojs-0.10for node andiojs-1.3for iojs ..I think that the download link should not take the executable name.
am11 commentedon Feb 26, 2015
@boopathi, yes and that issue has been fixed.
am11 commentedon Feb 26, 2015
Closing this as external. The quick workaround is to use
iojsprefix (instead ofnode) when using io.js runtime.Alternatively, install nvmw, which has circumvented this issue by injecting
node.cmdin the io.js folder. (see the aforementioned appveyor and io.js issues)