Fatima -tuz-johora
Fatima -tuz-johora

Reputation: 1

npm installation in command prompt

After setting new windows in my laptop,i am trying to install npm in command prompt.But i am facing an error which picture is given in below.Would anybody help me out?

npm errors

Upvotes: 0

Views: 1240

Answers (3)

Syed Ahmad
Syed Ahmad

Reputation: 1

If you are trying to install npm(node package manager) do it by downloading it from here: https://www.npmjs.com/get-npm, then you are good to go.

The command you are actually giving is to install a package using npm(check https://docs.npmjs.com/cli/install).

Thats why the error shows could not install from "" as you have not specified any package to install.

Upvotes: -1

Quentin
Quentin

Reputation: 943556

Npm is already installed. That is why the error message is not Command not found.

The specific command you issued npm install -g attempts to use npm to install the package in the current directory globally.

Leaving the point that installing packages globally is a bad idea aside, this is failing because you are running the command in a directory that does not contain a package. It is your home directory, not one containing a package.json file.

Upvotes: 1

Luca Kiebel
Luca Kiebel

Reputation: 10096

If you don't specify a package to install (like npm install -g nodemon) npm will try to install all packages from the current package.json file. If there is non, npm will throw this error.

Upvotes: 1

Related Questions