Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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

Open

Description

@Arcath

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?

Activity

  1. 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
  2. kevinsawicki commented on Mar 26, 2015

    @kevinsawicki
    Contributor

    Should apm not be using an identical environment to Atom so that any module that compiles anything will work when required in Atom?

    apm compiles all native modules against the v8 headers that ship with Atom.

    What error are you getting when node-sass is required?

  3. Arcath commented on Mar 26, 2015

    @Arcath
    Author

    The error is

    libsass bindings not found. Try reinstalling node-sass

  4. Arcath commented on Apr 16, 2015

    @Arcath
    Author

    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);'

    http_parser: '1.0',
    node: '0.10.35',
    v8: '3.14.5.9',
    ares: '1.9.0-DEV',
    uv: '0.10.30',
    zlib: '1.2.8',
    modules: '11',
    openssl: '1.0.1j'
    

    which returns a vastly different answer and using that information would give the binding I get during install.

  5. kentonv commented on Feb 16, 2016

    @kentonv

    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.

    $ /usr/share/atom/resources/app/apm/bin/node --version
    v0.10.40
    

    Why is Atom shipping this old node binary when Atom proper is running on something much newer?

  6. winstliu commented on Feb 16, 2016

    @winstliu
    Contributor

    @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+).

  7. Dhq commented on Apr 18, 2016

    @Dhq

    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?

  8. Arcath commented on Apr 19, 2016

    @Arcath
    Author

    @Dhq I ended up using node-sass in a child process which isn't ideal but it works for now.

  9. winstliu commented on Aug 25, 2016

    @winstliu
    Contributor

    apm and Atom are now on similar enough Node versions that I think this can be closed.

  10. Dhq commented on Sep 2, 2016

    @Dhq

    @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.
    
  11. Dhq commented on Sep 2, 2016

    @Dhq

    @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 :)

  12. winstliu commented on Sep 3, 2016

    @winstliu
    Contributor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions