npm Community Forum (Archive)

The npm community forum has been discontinued.

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

specifying a scoped package via github when it has a binary reference fails on install

What I Wanted to Do

I wanted to “npm install” a scoped package version from a github repository. This scoped package has a cli tool.

What Happened Instead

By the time the linking happened, the directory hadn’t appeared, and the link step failed for the binary in the repository, failing the entire install.

Reproduction Steps

add the following line to your package.json and try ‘npm install’:

    "@api-platform/client-generator": "git+ssh://",

Note: the error message you see is likely due to a failure of the build step with babel. I was able to check this code out from github directly and ‘npm install’ and ‘npm run build’ worked as expected. Also, npm install --no-bin-links succeeds


1195 verbose stack Error: ENOENT: no such file or directory, chmod '/Users/mdan/src/abc/node_modules/@api-platform/client-generator/lib/index.js'
1196 verbose cwd /Users/mdan/src/abc
1197 verbose Darwin 16.7.0
1198 verbose argv "/Users/mdan/.nvm/versions/node/v8.11.3/bin/node" "/Users/mdan/.nvm/versions/node/v8.11.3/bin/npm" "install"
1199 verbose node v8.11.3
1200 verbose npm  v6.2.0
1201 error path /Users/mdan/src/abc/node_modules/@api-platform/client-generator/lib/index.js
1202 error code ENOENT
1203 error errno -2
1204 error syscall chmod
1205 error enoent ENOENT: no such file or directory, chmod '/Users/mdan/src/abc/node_modules/@api-platform/client-generator/lib/index.js'
1206 error enoent This is related to npm not being able to find a file.
1207 verbose exit [ -2, true ]

Platform Info

$ npm --versions
{ abc: '0.0.1',
  npm: '6.2.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.32.0',
  node: '8.11.3',
  openssl: '1.0.2o',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.54',
  zlib: '1.2.11' }

$ node -p process.platform