78

I wanna run my project by npm run watch and when I do nothing, it suddenly appears an error like this.

git:(master) ✗ npm run watch

> watch
> npx mix watch

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bintangtobing/.npm/_logs/2021-06-04T08_11_16_499Z-debug.log

Does anyone know about these errors?

I have already did a solution, it is

delete node_modules on the project folder and run an npm install and it still got the same error.

Can anyone help me, please? Thank you, everyone.

Bin Ski.
  • 849
  • 1
  • 8
  • 10

17 Answers17

88

Ended up doing

rm -rf .git/hooks
npm install

Followin this sugestion https://github.com/npm/cli/issues/1845#issuecomment-814884999

Worked for me

Sr.PEDRO
  • 1,664
  • 19
  • 21
34

It worked for me:

npm uninstall husky && npm install --save-dev husky@4

It happens because git is trying to find a file that doesn't exist (in version 5) so downgrading helps, I know that's not the best solution but could help someone.

Or try to migrate husky (4 to 7):

https://github.com/typicode/husky-4-to-7

Erick Gutierrez
  • 446
  • 3
  • 7
9

My issue was is that I was mistakenly calling npx start instead of npm start.

I was doing this from the CMD line in my Dockerfile.

I realize this isn't the OPs question, but the error and title may bring others here who are getting this error.

shmuels
  • 1,039
  • 1
  • 9
  • 22
8

npm install

I had this problem after trying to debug a build issue. I deleted the node_modules and ran the app in a docker container. But this meant the husky npm package wasn't available locally anymore so a simple npm install fixed the problem

RooN3y
  • 144
  • 1
  • 7
8

In my case i was using wrong cmd . npx create react-app assignment

cmd should be like npx create-react-app my-project

mistake : I was missing "-" in between create and react in cmd

user9083933
  • 361
  • 3
  • 10
6

I had to downgrade node from v17.0.1 to v14.18.1, because newer node-version was not supported by one of my project's dependencies.

( e.g. via "nvm use 14", see Node Version Manager )

Alex
  • 789
  • 8
  • 8
6

It worked for me:

git commit -m "updating the dependency packages" --no-verify

Sometimes its due to pre-commit hooks

AnilS
  • 795
  • 1
  • 11
  • 15
3

I had tried installing npm in a repo that didn't need it, and the installation had failed, therefore

rm -rf .git/hooks

without using

npm install

worked for me (because npm install would fail again).

The Blind Hawk
  • 1,199
  • 8
  • 24
2

In my case, I was using npm build.

It worked after changing to npm run build.

laplace
  • 656
  • 7
  • 15
2

I was stuck on this error for a while. Very obvious, but I was simply running an invalid npx command. The message by itself wasn't very helpful and it took me quite some time to figure that out :'(

jgaurav6
  • 81
  • 4
1

npm audit fixed the issue for me while trying to run, npx ng n <folder-name>.

Angular was installed locally in this folder, which already contained an Angular project.

Nice Books
  • 1,675
  • 2
  • 17
  • 21
1

The error found after installing cypress; opening cypress with the path works fine :

./node_modules/.bin/cypress open
tan js
  • 204
  • 2
  • 10
1

You can install globally the eas-cli package and the command should work.

Install it with npm:

npm install -g eas-cli

Install it with yarn:

yarn global add eas-cli
Gonzalo
  • 168
  • 1
  • 1
  • 7
0

npx react-native run-android npm ERR! couldn't determine execution to run this helped me to run

 npm i yarn
 yarn install

enter image description here

مصطفى
  • 555
  • 4
  • 9
0

terminal was .zsh, my problem was fixed when I changed it to .bash

0

I had this problem with Expo using node 16, fixed by using node 18.

=> nvm use 18

Maybe not a proper solution, but it un-blocked me..

Made in Moon
  • 2,294
  • 17
  • 21
-1

just use npm install then -> npm start

Byomkesh
  • 1
  • 1