npm ci –no-bin-links is not honored

What I Wanted to Do

I expected npm ci –no-bin-links to not create the node_modules/.bin folder with symbolic links into.

What Happened Instead

Folder and symbolic links are created.

Reproduction Steps

  • Create an empty package.json
  • run npm install typescript@3.5.3 --no-bin-links
  • check the node_module folder. There is no .bin folder and no symbolic links
  • remove the node_module folder
  • run npm ci --no-bin-links
  • check the node_module folder. There is a .bin folder with symbolic links

Details

N/A

Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.14.2',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.45',
  zlib: '1.2.11' }

$ node -p process.platform
linux

FYI, same problem with npm 6.4.1.

There aren’t any options listed in npm help ci or https://docs.npmjs.com/cli/ci.html, and I am not sure if there is an expectation that (any/all) install flags are supported.

In contrast --no-bin-links is listed in npm help install and https://docs.npmjs.com/cli/install.html

Thanks for answer, I though all flags are supported. In documentation there is : This command is similar to npm-install and

In short, the main differences between using npm install and npm ci are:

  • The project must have an existing package-lock.json or npm-shrinkwrap.json .
  • If dependencies in the package lock do not match those in package.json , npm ci will exit with an error, instead of updating the package lock.
  • npm ci can only install entire projects at a time: individual dependencies cannot be added with this command.
  • If a node_modules is already present, it will be automatically removed before npm ci begins its install.
  • It will never write to package.json or any of the package-locks: installs are essentially frozen.

Maybe it’s a misunderstanding from me but if I use --ignore-scripts, the flag is honored by npm ci command. So why not take care of --no-bin-links?

Fair assumption and fair question. :slight_smile: