node.js - 将 git 依赖项添加到 Nodejs 应用程序

标签 node.js github dependencies requirejs npm

我正在尝试添加 require-cs到我的nodejs项目,我可以将r.js与coffeescript文件一起使用。我正在尝试将其直接添加到 package.json 中,以便我可以直接使用 git 存储库更新它。当我添加它时,出现以下错误:

npm ERR! Error: ENOENT, open '/tmp/npm-1336369606543/1336369606543-0.5654201323632151/package.json'

它不会将 git 添加到我的应用程序中。我的 package.json 如下所示:

{
  "name": "App",
  "version": "0.0.1",
  "dependencies": {
    "mocha": "~1.0.2",
    "chai": "~0.5.3",
    "coffee-script": "~1.3.1",
    "express": "~2.5.9",
    "redis2json": "0.0.5",
    "nohm": "~0.9.0-pre3fixed",
    "redback": "~0.2.8",
    "database-cleaner": "~0.7.0",
    "zombie": "~0.13.4",
    "underscore": "~1.3.3",
    "redis": "~0.7.2",
    "hiredis": "~0.1.14",
    "connect-redis": "~1.3.0",
    "requirejs": "~1.0.8",
    "freebase": "~1.0.1",
    "require-cs": "git://github.com/jrburke/require-cs.git"
  }
}

是否可以使用 package.json 和 npm 将 cs.js 添加到我的存储库?

谢谢。

最佳答案

npm 在包的根目录中查找 package.json 文件。它告诉 npm 包的结构如何,以及如何安装它。该错误无法在 git://github.com/jrburke/require-cs.git 中找到它正在查找的 package.json

查看this question也是如此。

http://toolbox.no.de/是一个很好的 npm 资源。

关于node.js - 将 git 依赖项添加到 Nodejs 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10477363/

相关文章:

linux - 克隆 git 存储库时权限被拒绝

windows - 如何让旧的 VB6 应用程序在 Windows Vista 和 Windows 7 中运行?

java - 将 HtmlUnit 导入到 Android 项目

java - 使用 Java 和 Vue 创建 Web 应用程序的更好方法

git - SHA-1 用于提交到 github

javascript - babel React 查找模块时出现问题

git - 您如何从 fork 的 github 存储库 merge 非主分支上的更改?

go - 使用 dep 时强制依赖项的特定版本

javascript - Sequelize 如何检查数据库中是否存在条目

Node.JS RC2-CBC 加密和解密密码与 C# 不匹配