0

I am creating a new project and I use npm to create a package for it, but unfortunately this time it didn't work, and when I run npm init it says the following in the image below:

hyper command running npm init with the error

C:\Users\HWIN10\doc\programming\intro-to-node\weatherProject>npm init
'npm' is not recognized as an internal or external command,  
operable program or batch file.
Daniel_Knights
  • 7,940
  • 4
  • 21
  • 49
  • probably `npm` doesn't set on your PATH? check here maybe? https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10 – halilcakar Jun 20 '20 at 15:24
  • Have you downloaded Node? – Daniel_Knights Jun 20 '20 at 15:51
  • Check here you will see similar problem. It should be with ur file path [File Path](https://stackoverflow.com/questions/33055515/npm-is-not-recognized-as-an-internal-or-external-command-operable-program-or) – XeusKing Jun 20 '20 at 16:08

2 Answers2

0

If you don't have node js installed in your machine you should install it first then try to use Nodejs.

Npm is automatic install after/with while installling node js. Nodejs

MD. Sani Mia
  • 272
  • 1
  • 7
0

You can try what this man said to do on his website.

Open

Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables

In "User variables" or "System variables" find variable PATH and add node.js folder path as value.

Usually, it is C:\Program Files\nodejs.

If the variable doesn't exist, create it. Restart your IDE or computer.

Try this article node is not recognized as an internal or external command

Not A Bot
  • 2,474
  • 2
  • 16
  • 33