我正在尝试添加 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/