npm Community Forum (Archive)

The npm community forum has been discontinued.

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

prepare scripts not run for git modules on Jessie

What I Wanted to Do

Installed a git module. Expected the git prepare script to run.

What Happened Instead

The debug output said that the prepare script would run, but the distribution files were not actually created. It works properly on macOS, but not when run within the standard Node.js docker containers (jessie).

Reproduction Steps

npm install [git module]


Platform Info

$ npm --versions
{ npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.33.0',
  node: '8.14.0',
  openssl: '1.0.2q',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.23.2',
  v8: '6.2.414.72',
  zlib: '1.2.11' }
$ node -p process.platform

Looks like a problem with me running NPM as root…

Can you give more info or provide a better repro?

Ah, sorry for not clarifying better. I was able to fix the problem by running NPM as a normal user, and that fixed the issue. It looks like running the prepare script as root caused some sort of error with the prepare step.

Ah right. We’re planning on fixing this with npm@7, but for now, we drop permissions for prepare to a user that probably can’t do this.