./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.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:28 AM.

Comments are currently closed for this discussion. You can start a new one.

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

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM