Failed to run npm to install my package

I am trying to install the package for which I defined package.json . The package.json file is very simple.

{ "name": "project", "version": "0.0.1", "devDependencies": { "karma-jasmine": "0.2.2" } } 

Now that I issue

 npm install . 

I get the following error.

 npm WARN package.json package.json@0.0.0 No repository field. npm ERR! addLocal Could not install /Users/username/projects/project npm ERR! Darwin 14.0.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "." npm ERR! node v0.10.32 npm ERR! npm v2.1.5 npm ERR! code EISDIR npm ERR! errno 28 npm ERR! EISDIR, read npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <http://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! /Users/username/projects/project/npm-debug.log 

It is impossible to understand what I am doing wrong.

+7
source share
2 answers

After spending a lot of time on this, I finally understood the reason. I did not have a package.json file, but I had it misspelt as a packages.json file.

NPM was unable to pick up the file from the current directory, and then tried my home directory and then showed a useless error. Hope this helps someone save some time.

+8
source share

Top tip. After creating a new project github repository and cloning it locally, run the command:

 npm init 

which will request data and automatically synthesize the file

 package.json 

for you

UPDATE: I see that it is fixed ... my current version has a much better error message:

 npm install npm WARN ENOENT ENOENT: no such file or directory, open '/home/scott/aaa/package.json' node --version v5.4.1 npm --version 3.3.12 
+6
source share

All Articles