最佳答案
尝试从GitHub安装模块会导致此错误:
关于package.json.的ENOENT错误
使用Express轻松复制:
npm install https://github.com/visionmedia/express
抛出错误。
npm install express
工作。
为什么我不能从GitHub安装?
这是控制台输出:
npm http GET https://github.com/visionmedia/express.gitnpm http 200 https://github.com/visionmedia/express.gitnpm ERR! not a package /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/tmp.tgznpm 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! <npm-@googlegroups.com>
npm ERR! System Linux 3.8.0-23-genericnpm 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/somenamenpm ERR! node -v v0.10.10npm ERR! npm -v 1.2.25npm ERR! path /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.jsonnpm ERR! code ENOENTnpm ERR! errno 34npm ERR!npm ERR! Additional logging details can be found in:npm ERR! /home/guym/dev_env/projects_GIT/proj/somename/npm-debug.lognpm ERR! not ok code 0