Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to npm install my package

Tags:

node.js

npm

I've been trying to install a package that I have defined the package.json for. The package.json file is very simple.

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

Now when I issue a

npm install .

I get the following error.

npm WARN package.json [email protected] 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

Unable to understand what am I doing wrong.

like image 439
toomasr Avatar asked Oct 27 '14 11:10

toomasr


People also ask

Why is my npm install not working?

If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).

How do I force an NPM package to install?

The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk. The -g or --global argument will cause npm to install the package globally rather than locally.


1 Answers

After spending a lot of time on this I finally figured out the cause. I didn't have a package.json file but I had it misspelt as packages.json file.

NPM wasn't able to pick up the file from the current directory and then it tried my home directory and then showed the unhelpful error. I hope this will help somebody save some time.

like image 160
toomasr Avatar answered Sep 28 '22 06:09

toomasr