./node_modules/.bin is not in the path

justin's Avatar

justin

05 Apr, 2015 07:51 PM

It's pretty standard for node packages to ship "bin" scripts which go into ./node_modules/.bin and you can then invoke with single word command such as "mocha".

It seems like ./node_modules/.bin is not in the path by default and I think it probably should be. Just a suggestion.

  1. 1 Posted by Tommy Parnell on 08 May, 2015 03:50 AM

    Tommy Parnell's Avatar

    Don't they only get added to the path if you install with the -g switch? AKA install as a global.

  2. 2 Posted by justin on 08 May, 2015 08:43 PM

    justin's Avatar

    The scripts get added to ./node_modules/.bin relative to wherever you install it. So depending on your path it may resolve the commands from the working directory of the project without having to install the package globally.

    This would be convenient in this case so you don't have to install a bunch of stuff globally in the appveyor file, you can just specify it in your package.json like normal and it will all still resolve.

    It just so happens that I add a new package and the build fails because I forget to update the appveyor file. You then have to add the dependency there too then your'e ok. Minor inconvenience.

  3. 3 Posted by jacobq on 22 May, 2018 07:08 PM

    jacobq's Avatar

    I am used to having the relative location `node_modules/.bin` in my path and would love for this to be the default on AppVeyor VM images. This is especially true since I've encountered some inconsistencies between platforms/images with `yarn global add ...` package binaries/scripts not being in the path.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

16 Jun, 2018 09:22 AM
15 Jun, 2018 09:31 PM
15 Jun, 2018 08:31 PM
15 Jun, 2018 04:29 PM
15 Jun, 2018 12:39 PM
15 Jun, 2018 12:37 PM