0

I try to create a new react project:

npx create-react-app my-app

I get an error:

bash: /usr/bin/npx: No such file or directory

Tried solution:

ln -s /usr/bin/nodejs /usr/bin/node
ln: failed to create symbolic link '/usr/bin/node': File exists

The version:

npm -v npx
6.14.14

What should I do?


which npx
/usr/local/bin/npx

.

ls -l /usr/bin | grep npx
(no result)

.

whereis npx
npx: /usr/local/bin/npx /usr/share/man/man1/npx.1
ar2015
  • 5,558
  • 8
  • 53
  • 110
  • add output of `which npx`, `ls -l /usr/bin | grep npx`, `whereis npx` commands – rzlvmp Aug 24 '21 at 01:16
  • Did you try to restart bash terminal window? This may be a reason. Also you may avoid this error by using full path: `/usr/local/bin/npx create-react-app my-app`. – rzlvmp Aug 24 '21 at 01:25
  • maybe this topic can help you https://askubuntu.com/questions/250971/no-such-file-or-directory-error-while-using-npm – rzlvmp Aug 24 '21 at 01:27
  • bash restart fixed it. I did not expect this from linux bash. – ar2015 Aug 24 '21 at 01:29

1 Answers1

5

For me, the solution was to restart the bash terminal.

ar2015
  • 5,558
  • 8
  • 53
  • 110