Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Trying to install modules from github results in ENOENT error on package.json.

Easily reproduced using express

npm install https://github.com/visionmedia/express

throw error.

npm install express

works.

Why can't I install from github?

Here is the console output

npm http GET https://github.com/visionmedia/express.git
npm http 200 https://github.com/visionmedia/express.git
npm ERR! not a package /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/tmp.tgz
npm ERR! Error: ENOENT, open '/home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Linux 3.8.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "https://github.com/visionmedia/express.git"
npm ERR! cwd /home/guym/dev_env/projects_GIT/proj/somename
npm ERR! node -v v0.10.10
npm ERR! npm -v 1.2.25
npm ERR! path /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/guym/dev_env/projects_GIT/proj/somename/npm-debug.log
npm ERR! not ok code 0
share|improve this question
 
This is a comment about the "hold" the question is in. I think this question falls into the part of "unless they directly involve tools used primarily for programming". NPM is a tool used directly for programming so it makes this question legit. –  guy mograbi Jul 7 '13 at 10:31
add comment

1 Answer

up vote 16 down vote accepted

Because https://github.com/visionmedia/express is the URL of a web page and not an npm module. Use this flavor:

git+ssh://[email protected]/visionmedia/express.git
share|improve this answer
8  
You can also use git+https://github.com/visionmedia/express.git to use https rather than ssh. –  Steve Willcock Jul 7 '13 at 10:36
 
I was trying to run npm install on Windows (it did not have ssh) and hence could not create a repository using git+ssh url but @SteveWillcock 's comment above solved the problem. –  Chirayu Shishodiya Jan 10 at 16:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.