npm / cmd-shim

The cmd-shim used in npm
ISC License
76 stars 40 forks source link

Having a file named node.js will be "run" instead of node #40

Closed coolaj86 closed 5 years ago

coolaj86 commented 5 years ago

See https://npm.community/t/windows-10-npm-opens-vscode-instead-of-running-postinstall-script-on/9911

I have a file named node.js, which is the node version of the code (a browser.js is coming).

I have a postinstall script with #!/usr/bin/env node

The postinstall in the package.json is

{ "scripts": {
    "postinstall": "node scripts/postinstall"
  },
  ...
}

Instead of running the postinstall script with node.exe, it opens node.js in a text editor.

isaacs commented 5 years ago

My guess is that .JS is in your PATHEXT environment variable.

Probably you wanna fix that.