Apm using ancient versions of node/npm and I can't seem to fix it…?


#1

I’m having trouble running apm rebuild as per instructions here: https://atom.io/docs/latest/behind-atom-developing-node-modules. I noticed there are ancient versions of both node and npm in the log:

~/d/p/ensime-node ❯❯❯ apm rebuild                                                 feature/typescript
Rebuilding modules ✗
npm WARN prefer global coffee-script@1.10.0 should be installed with -g
npm WARN prefer global jasmine-node@1.10.2 should be installed with -g
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: Unsupported target version: 0.34.5
node-pre-gyp ERR! stack     at get_runtime_abi (/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:156:23)
node-pre-gyp ERR! stack     at Object.module.exports.evaluate (/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:265:19)
node-pre-gyp ERR! stack     at install (/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/node-pre-gyp/lib/install.js:138:31)
node-pre-gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/node-pre-gyp/lib/node-pre-gyp.js:48:37)
node-pre-gyp ERR! stack     at run (/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:79:30)
node-pre-gyp ERR! stack     at Object.<anonymous> (/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:131:1)
node-pre-gyp ERR! stack     at Module._compile (module.js:456:26)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
node-pre-gyp ERR! stack     at Module.load (module.js:356:32)
node-pre-gyp ERR! stack     at Function.Module._load (module.js:312:12)
node-pre-gyp ERR! System Darwin 15.3.0
node-pre-gyp ERR! command "node" "/Users/viktor/dev/projects/ensime-node/node_modules/fsevents/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/viktor/dev/projects/ensime-node/node_modules/fsevents
node-pre-gyp ERR! node -v v0.10.40
node-pre-gyp ERR! node-pre-gyp -v v0.6.21
node-pre-gyp ERR! not ok

npm ERR! Darwin 15.3.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/viktor/.atom/.apm/.apmrc" "--userconfig" "/Users/viktor/.atom/.apmrc" "rebuild" "--target=0.34.5" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE
npm ERR! fsevents@1.0.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fsevents@1.0.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the fsevents package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls fsevents
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/viktor/dev/projects/ensime-node/npm-debug.log

I tried setting them myself in ~/.atom/.apmrc which didn’t exist before:

 ~/d/p/ensime-node ❯❯❯ cat /Users/viktor/.atom/.apmrc                            ⏎ feature/typescript
user-agent = "npm/3.7.5 node/v4.1.0 darwin x64"

but it doesn’t help… Any tips?


#2

Oh, the packaged node really is that old?

~/d/p/ensime-node ❯❯❯ /Applications/Atom.app/Contents/Resources/app/apm/bin/node --version
v0.10.40

From log:

/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/viktor/.atom/.apm/.apmrc" "--userconfig" "/Users/viktor/.atom/.apmrc" "rebuild" "--target=0.34.5" "--arch=x64"

#3
~/d/p/ensime-node ❯❯❯ apm --version                                               feature/typescript
apm  1.6.0
npm  2.13.3
node 0.10.40
python 2.7.10
git 2.7.0

#4
❯❯❯ /Applications/Atom.app/Contents/Resources/app/apm/bin/node -e 'console.log(process.versions);'
{ http_parser: '1.0',
  node: '0.10.40',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.36',
  zlib: '1.2.8',
  modules: '11',
  openssl: '1.0.1p' }

I guess this is a known: https://github.com/atom/apm/issues/328

So I guess I’m wondering, what problems will I have using link to develop sub-modules that simply are built with npm and can’t be rebuilt using apm?


#5

I’m having the same issue with apm rebuild and node-gyp as of updating to Atom 1.6

node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: Unsupported target version: 0.34.5
node-pre-gyp ERR! stack     at get_runtime_abi (/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:156:23)
node-pre-gyp ERR! stack     at Object.module.exports.evaluate (/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:265:19)
node-pre-gyp ERR! stack     at install (/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/node-pre-gyp/lib/install.js:138:31)
node-pre-gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/node-pre-gyp/lib/node-pre-gyp.js:48:37)
node-pre-gyp ERR! stack     at run (/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:79:30)
node-pre-gyp ERR! stack     at Object.<anonymous> (/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:131:1)
node-pre-gyp ERR! stack     at Module._compile (module.js:456:26)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
node-pre-gyp ERR! stack     at Module.load (module.js:356:32)
node-pre-gyp ERR! stack     at Function.Module._load (module.js:312:12)
node-pre-gyp ERR! System Darwin 15.3.0
node-pre-gyp ERR! command "node" "/Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/shmck/Desktop/project/atom-coderoad/node_modules/ava/node_modules/fsevents
node-pre-gyp ERR! node -v v0.10.40
node-pre-gyp ERR! node-pre-gyp -v v0.6.21
node-pre-gyp ERR! not ok 

npm ERR! Darwin 15.3.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/shmck/.atom/.apm/.apmrc" "--userconfig" "/Users/shmck/.atom/.apmrc" "rebuild" "--target=0.34.5" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE
npm ERR! fsevents@1.0.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fsevents@1.0.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the fsevents package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls fsevents
npm ERR! There is likely additional logging output above.

#6

Removing “devDependencies” from my package.json file and re-installing was the only way I found to fix the issue.


#7

Now I actually have problems with this for real. My package wont load because:

Failed to require the main module of ‘Ensime’ because it requires an incompatible native module.
Run apm rebuild in the package directory to resolve.

If I try to run apm rebuild it fails as above on fsevents@1.0.9 as a transitive dependency:

~/d/p/atom-ensime ❯❯❯ apm rebuild                                                         master ✱
Rebuilding modules ✗
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: Unsupported target version: 0.34.5
node-pre-gyp ERR! stack     at get_runtime_abi (/Users/viktor/dev/projects/atom-ensime/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:156:23)
…

Pretty please, help needed!


#8

This is a self-containing failing test on my machine:

mkdir fsevents-apm-rebuild
cd fsevents-apm-rebuild
apm init --package .
npm install -s fsevents
apm rebuild

Fails like above.


#9

I see that you’ve opened a new issue for this here:

If this is caused by the old version of node/npm, then I’ll probably mark it as duplicate of the “old node/npm” issue when I find it.


#10

Ok, cool! I could actually workaround my problem by removing the dependency on chokidar->fsevents to use gaze instead. So I guess it’s only fsevents of all the dependencies I had that was problematic. There’s talk about it here: https://github.com/strongloop/fsevents/issues/93 I don’t understand much of this but really needed to be able to build my atom package. After removing fsevents apm rebuild worked fine.

However, the runtime loading issue on atom-beta persisted but should probably be related to apm/atom vs apm-beta/atom-beta:
Failed to activate because native module. I’ll continue that there. Thanks @leedohm !