I'm trying to run two scripts concurrently, and I found this package concurrently
that supposedly would help me. I did npm install concurrently --save
and it's listed in my package.json
. When I go to run it, however, it throws:
concurrently: command not found
I don't understand why it can't find it despite being installed. I've set up the commands as shown here, so I know it can't be that. I've checked earlier instances of this issue, but it appears to be outdated. Is there another way I can check if this works, or should I try something else?
Screenshot:
When you install using npm install
without specifying the global
flag -g
, you are installing the module to your projects node_modules
folder. If that module has any runnable binaries, they will be added to node_modules/.bin
- so you should be able to run your local version of concurrently
by running node_modules/.bin/concurrently
(or from any folder in your project $(npm bin)/concurrently
). I personally prefer using the project's local dependencies over installing global ones so I have the option to use a different version in another project.
If you put a script into the package.json "scripts"
field it will reference these locally installed without having to specify the full path because npm run
adds your projects node_modules/.bin
to your path.
If you're having issues, I would start by checking the node_modules/.bin
folder and verifying that the binary for your script actually exists.
This issue also comes up when there is a dash "-" in your folder name. i.e. (/developer/api-movies) or even (/developer-apps/apiMovies. Use camelCase throughOut rather than dashes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With