Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gatsby run problem -'gatsby' is not recognized as an internal or external command, operable program or batch file

Tags:

npm

gatsby

Its odd as it did work now I cannot run Gatsby commands in VS code, CMD or Powershell

If I install it every thing works and I get the "success" bit and a list of useful commands. This may have happened after I experimented with Hugo. I get the feeling it might be my path???

I do get this error when I run

install -g gatsby-cli

npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

Any ideas, I have tried to clear NPM cache with no luck

Thanks

like image 484
user2786484 Avatar asked Nov 23 '25 15:11

user2786484


2 Answers

To answer the question, these are the warning which we get because some of our packages are outdated.

You can always identify the outdated versions and update them, but it will not be a harm, as it is just a warning.

npm outdated // to know all the outdated packages.
npm install --save core-js@^3 // update the core-js 

But if you are getting gatsby recognized as an internal or external command error, then execute,

$ npm install -g gatsby-cli

and if you want a fresh installation, then

$ npm uninstall gatsby-cli
$ npm install -g gatsby-cli
like image 93
KushalSeth Avatar answered Nov 25 '25 11:11

KushalSeth


If you are on Windows Gatsby most likely gets installed to:

C:\Users\yourUserName\AppData\Roaming\npm

make sure that the path above is in your environment variables under path

like image 30
Uros Randelovic Avatar answered Nov 25 '25 10:11

Uros Randelovic