我在我的应用程序的根目录中有以下package.json。
....
"dependencies": {
"LessonApi": "file:apis/lesson",
"SearchAPI": "file:apis/search",
"SlotApi": "file:apis/slots",
"UserAPI": "file:apis/user",
"bcrypt": "^0.8.3",
"co": "^4.5.4",
"co-mysql": "^1.0.0",
"koa": "^0.20.0",
"koa-basic-auth": "^1.1.2",
"koa-bodyparser": "^2.0.0",
"koa-cors": "0.0.16",
"koa-generic-session": "^1.9.0",
"koa-mount": "^1.3.0",
"koa-passport": "^1.1.6",
"koa-router": "^5.1.2",
"koa-session": "^3.3.0",
"mysql": "^2.7.0",
"passport-facebook": "^2.0.0",
"sql-fixtures": "^0.11.0"
},
.....我在/apis/lesson上有一个自定义模块。但是,一旦我在应用程序的根目录下安装npm,它就会失败,并给出这个错误。
git clone git@github.com:file:apis/slots Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-file-apis-slots-6576eaee'...
npm ERR! git clone git@github.com:file:apis/slots fatal: remote error:
npm ERR! git clone git@github.com:file:apis/slots is not a valid repository name
npm ERR! git clone git@github.com:file:apis/slots Email support@github.com for help
npm ERR! git clone git@github.com:file:apis/lesson Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-file-apis-lesson-7b1b575f'...
npm ERR! git clone git@github.com:file:apis/lesson fatal: remote error:
npm ERR! git clone git@github.com:file:apis/lesson is not a valid repository name
npm ERR! git clone git@github.com:file:apis/lesson Email support@github.com for help
npm ERR! 404 404 Not Found: SlotApi
npm ERR! 404
npm ERR! 404 'SlotApi' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'GetGoAPI'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.13.0-52-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
....请解释为什么这不起作用,因为从逻辑上讲,我觉得我应该能够有本地依赖。
发布于 2015-07-09 16:15:19
对于其他可能偶然发现这一点的人,@Tom Robinson的评论正确地回答了这个问题。我只需要更新到npm v2.0.0。
这可以通过以下方式完成:
sudo npm install npm -g发布于 2015-07-09 16:15:49
file:是作为2.0.0版本的一部分添加的,因此需要升级npm。
https://stackoverflow.com/questions/31310791
复制相似问题