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 Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
apm does not (appear) to have the same node version as atom #328
When installing node-sass it compiles a binding for your os/node version which it then calls later when you require it.
When install via apm install it creates (on my machine) win32-ia32-node-0.10 which is rightly not my system node version. If i then try to require node-sass in my package I get the error that no binding is available and I should re-install node-sass.
Looking at the process.sassBinaryName in Atom it is looking for win32-ia32-atom-1.0
Should apm not be using an identical environment to Atom so that any module that compiles anything will work when required in Atom?
changed the title [-]apm does not (appear) have the same node version as atom[/-][+]apm does not (appear) to have the same node version as atom[/+]on Mar 26, 2015
Doing some more testing with the node-sass 3.0.0 beta which uses {platform}-{arch}-{modules version} to name its libsass binding. Installed by apm on my machine that results in win32-ia32-11 but run the same function in atom and I get win32-ia32-43.
running process.versions in atom:
modules: '43'
node: '1.5.1'
...
v8: '4.1.0.21'
run the command C:\path\to\atom\app-0.192.0\resources\app\apm\bin\node -e 'console.log(process.versions);'
apm compiles all native modules against the v8 headers that ship with Atom.
Sure, but many npm modules include build scripts that do things like try to stamp the library with the node or v8 version to detect ABI version skew. Those scripts make the reasonable assumption that they are building for the version of node which is executing the script. But under apm, these scripts are run using node 0.10, so they get confused and use that version for the stamp, even if they are actually building against newer headers.
@kentonv There have been attempts in the past to upgrade apm to something newer, but I believe they all ran into some difficulties (one particular one that I'm aware of is that all commands fail on 0.12+).
I just ran in to this same problem, also with node-sass. Did you ever find a solution @Arcath, or was it just concluded that node-sass, atom and windows just won't work at the moment?
@50Wliu Well, in the case of node-sass at least it still doesn't work. On my windows machine, apm installs bindings in node-sass for win32 with node 4.x, while inside Atom it seems to be looking for a win32 on node 5.X.
Missing binding C:\XXX\node_modules\node-sass\vendor\win32-ia32-47\binding.node
Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x
Found bindings for the following environments:
- Windows 32-bit with Node.js 4.x
This usually happens because your environment has changed since running npm install.
Run `npm rebuild node-sass` to build the binding for your current environment.
@Dhq After doing some investigation, I've come to the conclusion that my above comment was wrong. Sorry about that.
What appears to be happening is that while Atom is built using Node 4 on Appveyor, it still inherits Electron's Node version. We currently use Electron 0.37.8, which uses Node 5.10.0.
Activity
[-]apm does not (appear) have the same node version as atom[/-][+]apm does not (appear) to have the same node version as atom[/+]kevinsawicki commentedon Mar 26, 2015
apm compiles all native modules against the v8 headers that ship with Atom.
What error are you getting when
node-sassis required?Arcath commentedon Mar 26, 2015
The error is
libsassbindings not found. Try reinstallingnode-sassArcath commentedon Apr 16, 2015
Doing some more testing with the node-sass 3.0.0 beta which uses
{platform}-{arch}-{modules version}to name its libsass binding. Installed by apm on my machine that results inwin32-ia32-11but run the same function in atom and I getwin32-ia32-43.running
process.versionsin atom:run the command
C:\path\to\atom\app-0.192.0\resources\app\apm\bin\node -e 'console.log(process.versions);'which returns a vastly different answer and using that information would give the binding I get during install.
kentonv commentedon Feb 16, 2016
Sure, but many npm modules include build scripts that do things like try to stamp the library with the node or v8 version to detect ABI version skew. Those scripts make the reasonable assumption that they are building for the version of node which is executing the script. But under apm, these scripts are run using node 0.10, so they get confused and use that version for the stamp, even if they are actually building against newer headers.
Why is Atom shipping this old node binary when Atom proper is running on something much newer?
winstliu commentedon Feb 16, 2016
@kentonv There have been attempts in the past to upgrade apm to something newer, but I believe they all ran into some difficulties (one particular one that I'm aware of is that all commands fail on 0.12+).
Dhq commentedon Apr 18, 2016
I just ran in to this same problem, also with node-sass. Did you ever find a solution @Arcath, or was it just concluded that node-sass, atom and windows just won't work at the moment?
Arcath commentedon Apr 19, 2016
@Dhq I ended up using node-sass in a child process which isn't ideal but it works for now.
winstliu commentedon Aug 25, 2016
apm and Atom are now on similar enough Node versions that I think this can be closed.
Dhq commentedon Sep 2, 2016
@50Wliu Well, in the case of node-sass at least it still doesn't work. On my windows machine, apm installs bindings in node-sass for win32 with node 4.x, while inside Atom it seems to be looking for a win32 on node 5.X.
winstliu commentedon Sep 2, 2016
Atom is using Node 4: https://github.com/atom/atom/blob/master/appveyor.yml#L15
Dhq commentedon Sep 2, 2016
@50Wliu Ok, thanks.
Can't understand why it's looking for node 5.X for me then. My global node locally is 6.0.0... Will try to find it out :)
winstliu commentedon Sep 3, 2016
@Dhq After doing some investigation, I've come to the conclusion that my above comment was wrong. Sorry about that.
What appears to be happening is that while Atom is built using Node 4 on Appveyor, it still inherits Electron's Node version. We currently use Electron 0.37.8, which uses Node 5.10.0.