Skip to content

Error: Invalid argument during require #199

@vaguue

Description

@vaguue

Hi! When I tried to test prebuild-install locally I got this error: Error Invalid arguments. I checked the source and here is the place where this error is emitted:

if (opts.runtime === 'node' && opts.platform === process.platform && opts.abi === process.versions.modules && opts.arch === process.arch) {
  try {
    require(resolved) // ERROR HERE
  } catch (err) {
    console.log('error', err);
    return cb(err)
  }
  log.info('unpack', 'required ' + resolved + ' successfully')
}

It's very strange, because when I comment the require part everything works after that (I can use my module from the system, no errors whatsoever). Some info about my setup:

  • Backend cmake-js
  • During the prebuild phase I use node runtime, because my module is meant to be used from the Node and relies on libuv to work properly
  • Repo: https://github.com/vaguue/over-the-wire
  • My package is commonJS
  • node --version: v21.5.0

Thanks in advance!

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