作者:ah_落落_181 | 来源:互联网 | 2022-12-31 10:35
我正在尝试从私有GitLab instence安装NPM依赖项.
所以,我有基本文件的repo
我package.json
在我的项目中添加了这个依赖项
"node-demo-package": "https://oauth2:@gitlab.fullurl.git"
但是,当我运行时npm install
,我收到此错误消息:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: node-demo-package@https://oauth2:@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": "git@gitlab.fullurl.git"
},
"author": "Arnaud Delante",
"license": "MIT"
}
我已经尝试切换https
的git+https
,但我得到另一个错误
npm ERR! Error while executing:
npm ERR! /usr/local/bin/git ls-remote -h -t https://oauth2:@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:@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
这很奇怪,因为令牌是正确的.
你有什么想法吗?