Windows: npm install with --prefix does not link executables to the .bin directory

(Daniel Lorenzo) #1

What I Wanted to Do

run npm install with --prefix option to install dependencies for a specific package dependency

What Happened Instead

the subfolder node_modules was created in the package folder, but the linked binaries appeared in the package folder, instead of node_modules/.bin subfolder…

Reproduction Steps

npm install --prefix node_modules/any-package


the package is defined as a local dev-dependency, like so (snippet):

  "mypackage": "file:./submodules/mypackage",

Platform Info

Windows 10

$ npm --versions
{ 'mypackage': '0.1.0',
  npm: '5.6.0',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.1',
  openssl: '1.0.2m',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.47',
  zlib: '1.2.11' }
$ node -p process.platform

(Kat Marchán) #2

This seems to be working as intended. --prefix might be confusing, but it literally shifts all operations, including bin linking.

(system) closed #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.