Can Atom be built on node superior to v8.x?


#1

Hi, I’m trying to build the current git HEAD (as of writing) on my arch system. It seems probable that Atom can’t be built on node.js of a version superior to v8.x.

I followed instructions found here:
https://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-linux

The current git HEAD pulls dependencies, among which nan@2.7.0 (by way of another dependency I haven’t bothered researching as yet), and the subsequent build fails with the following build error appearing in the logs:

../../nan/nan_maybe_43_inl.h:112:15: error: « class v8:
:Object » n'a pas de membre nommé « ForceSet »
   return obj->ForceSet(isolate->GetCurrentContext(), k
ey, value, attribs);
               ^~~~~~~~

error: ‘class v8::Object’ has no member named ‘ForceSet’

It very well looks like nan was only changed to support node.js after v8.x somewhere between v2.7.0 and v.2.8.0 (and only made it into a release in v2.8.0):

Can someone confirm that node.js above v8.x is unsupported for building Atom? I’m happy to open an issue on github, but I would like confirmation before I go through the trouble.

% apm -v
(node:12650) ExperimentalWarning: The fs.promises API is experimental
apm  1.19.0
npm  6.0.1
node 10.1.0 x64
atom 1.26.1
python 2.7.15
git 2.17.0

#2

The culprit seems to be electron-link@0.2.0 (see in atom/atom/script/package.json), which depends on leveldown@^1.6.0 (atom/electron-link/package.json).

leveldown@^1.6.0 is resolved as leveldown@1.9.0 which itself requires nan@~2.7.0 (Level/leveldown/package.json).

no link to the first package.json file on github because "new users can only put 2 links in a post, but it’s there at HEAD version.


#3

After close inspection of the Node.js codebase, it looks like building on Node.js v9.x might work, since the commit on nodejs/node that removes v8::Object::ForceSet os tagged for Node.js v10.0.0 and v10.1.0.

Problem persists for Node.js v10.x though, obviously.


#4

I ended up filing an issue on github.