Comment # 1 on bug 967533 from
This appears to be due to the new nodejs-libpath.patch - specifically this
chunk:

Index: node-v5.6.0/lib/module.js
===================================================================
--- node-v5.6.0.orig/lib/module.js
+++ node-v5.6.0/lib/module.js
@@ -459,7 +459,13 @@ Module._initPaths = function() {
     homeDir = process.env.HOME;
   }

-  var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
+  if fs.exists('/usr/lib64', fs.F_OK, function(err) {
+    if (!err) {
+      var paths = ['/usr/lib/node','/usr/lib64/node'];
+    } else {
+      var paths = ['/usr/lib/node'];
+    }
+  };

   if (homeDir) {
     paths.unshift(path.resolve(homeDir, '.node_libraries'));

fs.exists only takes two arguments; given the three arguments it seems like
fs.access was intended, although being an asynchronous function it would still
not have the intended effect.

I believe that the following code instead has the intended effect:

  try {
    fs.accessSync('/usr/lib64', fs.F_OK);
    var paths = ['/usr/lib/node','/usr/lib64/node'];
  } catch (e) {
    var paths = ['/usr/lib/node'];
  }

https://nodejs.org/api/fs.html#fs_fs_accesssync_path_mode

When tested on a 64-bit OS, the results are as expected:

~/rpmbuild/BUILD/node-v5.6.0$ out/Release/node
> require('module').globalPaths
[ '/home/<redacted>/.node_modules',
  '/home/<redacted>/.node_libraries',
  '/usr/lib/node',
  '/usr/lib64/node' ]

I will attach the altered nodejs-libpath.patch file for reference.


You are receiving this mail because: