我在从github安装我自己的某个依赖项时遇到了问题。从github安装NPM依赖项
我的package.json看起来是这样的:
{
"name": "smartorm",
"description": "Intelligent multi-database object relational mapping",
"private": true,
"main": "smart.js",
"dependencies": {
"mysql": "~2.5.0",
"graphlib": "Queuecumber/GraphLibJS#v1.1",
"promise": "~6.0.0",
"xtend": "Raynos/xtend#v4.0.0"
}
}
的依赖 “graphlib” 导致错误。这是我的一个库,所以我很确定我没有正确设置它。任何帮助,将不胜感激。
我跑npm install
npm http 304 https://registry.npmjs.org/graphlib
npm ERR! Error: No compatible version found: [email protected]'Queuecumber/GraphLibJS#v1.1'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.3.1","0.3.2","0.3.3","0.4.0","0.4.1","0.4.2","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.5.5","0.5.6","0.5.7","0.5.8","0.5.9","0.5.10","0.5.11","0.5.12","0.6.0","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","1.0.0-pre1","0.8.0"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:719:10)
npm ERR! at /usr/share/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
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.13.0-36-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /media/Data/Code/Active/SmartORM
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /media/Data/Code/Active/SmartORM/npm-debug.log
npm ERR! not ok code 0
时收到以下错误我有一个名为其与github上发布标题为“V1.1”相关的“1.1版”的标签。 该存储库的package.json在版本号字段下列出“1.1”。我已经从仓库这里
{
"name": "graphlib",
"description": "Directed graphs in JavaScript using a sparse (adjacency list) representation",
"private": true,
"version": "1.1"
}
我认为'private:true'只是让软件包不会被发布到npm,而不是从远程源安装它。 – mscdex 2014-10-01 23:29:17
@mscdex你说得对。但是,我解决了这个问题,并且我正在更新答案 – Qualcuno 2014-10-01 23:40:47
3部分版本号修复了它。我搜索了一段时间,但从来没有看到任何地方记录。 – 2014-10-02 13:42:59