从 GitHub 检索 Node.js 模块 - 错误:ENOENT,打开 package/package.json' [英] Retrieving Node.js Module from GitHub - Error: ENOENT, open package/package.json'

查看:71
本文介绍了从 GitHub 检索 Node.js 模块 - 错误:ENOENT,打开 package/package.json'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,'npm' 知道 git,所以我可以用它从 github 检索 Node.js 模块.因此,我创建了 Node.js 模块并将其托管在 github 上.当我尝试将它安装在我的 Node.js 项目中时,如下所示:

To my understanding, the 'npm' knows about git, so i can use it to retrieve Node.js modules from github. So, I have created Node.js module and hosted it at github. When I try to install it in my Node.js project as following:

npm install git://github.com/git-user/repo.git

然后我收到以下错误:

 Error: ENOENT, open '/Users/kapa/tmp/npm-12237/1371351143597-0.9469406655989587/package/package.json'
...
code ENOENT
npm ERR! errno 34

我做错了什么以及如何从 github 安装模块?谢谢

What am i doing wrong and how to install module from github? Thank You

推荐答案

您的存储库是否包含正确的 package.json 文件?这是将您的存储库作为 npm 模块处理所必需的.

Does your repository contain a proper package.json file? That is required to have your repository handled as an npm module.

这篇关于从 GitHub 检索 Node.js 模块 - 错误:ENOENT,打开 package/package.json'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆