Local npm install doesn't create symlink to "bin" executables

Viewed 3353

If I create a minimal package.json file:

{
  "name": "cli-test",
  "version": "1.0.0",
  "bin": "index.js",
  "main": "index.js"
}

and an index.js file:

#!/usr/bin/env node
console.log("Hello")

and run npm install, why doesn't npm create a ./node_modules/.bin/cli-test symlink to my index.js file? The package.json documentation says this on "bin":

On install, npm will symlink that file into prefix/bin for global installs, or ./node_modules/.bin for local installs.

If I do npm install -g, a symlink is created, but I don't want a global install. I'm using node 6.10.3 and npm 3.10.10. Also tried with npm 5.0.4.

1 Answers
Related