Pkg: node10: process.binding(...).internalModuleReadFile is not a function

Created on 15 Jul 2018  路  5Comments  路  Source: vercel/pkg

Just a head up that in newer node versions process.binding(...).internalModuleReadFile is removed in favour of a JSON-specific variant - not sure what it will end up being.

Although in some versions this seems to be a simple rename, it is only reasonable to assume change implementation will follow, and my best guess is that it eventually will be the goto method that allows fast sync read of "package.json".

  require('./test')  // test has index.js and no package.json
pkg/prelude/bootstrap.js:1176
      throw error;
      ^

TypeError: process.binding(...).internalModuleReadFile is not a function
    at Object.fs.internalModuleReadFile.fs.internalModuleReadJSON (pkg/prelude/bootstrap.js:1127:36)
    at internalModuleReadJSON (internal/modules/cjs/loader.js:31:68)
    at readPackage (internal/modules/cjs/loader.js:156:16)
    at tryPackage (internal/modules/cjs/loader.js:172:13)
    at Function.Module._findPath (internal/modules/cjs/loader.js:282:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:589:25)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1270:44)
    at Function.Module._load (internal/modules/cjs/loader.js:518:25)
    at Module.require (internal/modules/cjs/loader.js:648:17)
    at Module.require (pkg/prelude/bootstrap.js:1157:31)

Most helpful comment

Heads up: Node 10 is scheduled to be promoted to LTS at the end of this month. Is this project still being maintained?

All 5 comments

Encountered this issue too. Might have been premature for me to use node 10 for now.

Also noticed that pkg only does 10.4.1 instead of the latest 10.7.0 when using node10 as the target.

This fixes the issue for me (no problems since I added the pull request): #461

Any chance on getting any of the open PRs for this issue merged?

We're also seeing this issue on node 10.9.0.

Any progress about this issue? I'd love to be able to upgrade my packaged tools to Node v10.

Heads up: Node 10 is scheduled to be promoted to LTS at the end of this month. Is this project still being maintained?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ydubois-fr picture ydubois-fr  路  4Comments

Araknos picture Araknos  路  4Comments

bergheim picture bergheim  路  3Comments

ndrantotiana picture ndrantotiana  路  4Comments

jflayhart picture jflayhart  路  4Comments