I wanted to start a Node app and created a package.json file with a tutorial. Here is the json file:
{
\"name\": \"Dashboard\",
I got the same exception also, but it was previously running fine in another machine. Anyway above solution didn't worked for me. What i did to resolve it?
Done :) Hope it helps.
It's simple, you're just not in the right directory.
Go to the C:\Program Files\nodejs\node_modules\npm
and you should be able to run this command properly.
Try to update npm,It works for me
[sudo] npm install -g npm
I got this error when I had a space in my "name" within the packagae.json file.
"NPM Project" rather than "NPMProject"
I was following a doc on line and thought this error meant a problem with the dependencies in NPM. however after a third look. I realized that it was a typo. I did not add a comma after the first dependency in package.json that the tutorial asked me to edit.
Try to add this:
"private": true,
it worked for me.
EDIT (for people asking why):
The Oficial documentation states the following:
If you set "private": true
in your package.json, then npm will refuse to publish it.
This is a way to prevent accidental publication of private repositories. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the publishConfig
hash described below to override the registry
config param at publish-time.
The error messages you are getting may be related to violating this "rule" in a way (mine was).
"private": false
.