我正在尝试从私有 GitLab 实例安装 NPM 依赖项。
所以,我有带有基本文件的存储库
我在中添加了这个依赖项package.json
在我的项目上
"node-demo-package": "https://oauth2:<ACCESS TOKEN>@gitlab.fullurl.git"
但是,当我跑步时npm install
,我收到此错误消息:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: node-demo-package@https://oauth2:<ACCESS TOKEN>@gitlab.fullurl.git.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/arnaud.delante/.npm/_logs/2018-01-24T15_05_49_456Z-debug.log
我不明白,因为有一个package.json
如屏幕截图所示。
这里是
{
"name": "demo-package",
"version": "1.0.0",
"description": "Test pasckage",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "[email protected] /cdn-cgi/l/email-protection"
},
"author": "Arnaud Delante",
"license": "MIT"
}
我已经尝试过切换https
by git+https
但我收到另一个错误
npm ERR! Error while executing:
npm ERR! /usr/local/bin/git ls-remote -h -t https://oauth2:<ACCES TOKEN>@gitlab.fullrul.git
npm ERR!
npm ERR! remote: You are not allowed to download code from this project.
npm ERR! fatal: unable to access 'https://oauth2:<ACCES TOKEN>@gitlab.fullrul.git': The requested URL returned error: 403
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/arnaud.delante/.npm/_logs/2018-01-24T17_19_16_677Z-debug.log
这很奇怪,因为令牌是正确的。
你有什么想法吗?