npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm rebuild doesn't pass arguments to postinstall scripts

What I Wanted to Do

Trying to use npm rebuild <pkg> to build native dependencies of pkg defined in package.json. Please note that these are not my native modules rather native modules required by a dependency I use.

Used npm rebuild <pkg> --arg=1 --arg2=2 //some dummy arguments

What Happened Instead

postinstall script of the package using native module is correctly invoked by npm, but arguments specified are not passed to aforementioned postinstall script.

Reproduction Steps

Any package.json having a npm dependency which specifies a postinstall step.

Platform Info

$ npm --versions
  <redacted>: '4.0.0-canary',
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  llhttp: '1.1.4',
  modules: '72',
  napi: '4',
  nghttp2: '1.38.0',
  node: '12.6.0',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.30.1',
  v8: '',
  zlib: '1.2.11'
$ node -p process.platform