I wanted to start a Node app and created a package.json file with a tutorial. Here is the json file:
{
\"name\": \"Dashboard\",
1)Nodejs installs in C:\ProgramFiles in some cases. Try installing in C: drive or another directory if you don't have admin rights.
2)Make sure you are not installing behind a company's proxy setting. This can sometimes affect installation.
3) Finally, make sure you run the npm command from this directory: Path\nodejs\node_modules\npm where Path is your own directory.
I had an "Invalid Name"
I switched from "name": "Some Name",...
to "name": "Some-Name",...
Guess name
needs to be a sluggy string.
Problem with not reading the json is linked to permission issues with the file.
Using this command will do the trick:
sudo chown -R $USER:$GROUP ~/.npm
Recently, I've started to get an error:
npm ERR! install Couldn't read dependencies
npm ERR! Error: Invalid version: "1.0"
So, you may need to specify version
of your package with 3 numbers, e.g. 1.0.0
instead of 1.0
if you get similar error.
I figured out I wasn't in the correct folder. I needed goto the folder I just cloned before I ran this command.