【发布时间】:2020-03-06 10:07:03
【问题描述】:
我有 2 个存储库。一是main,二是依赖包。
在 .gitlab-ci.yml 的主项目中,我有:
install_dependency:
stage: install-dep
before_script:
- npm config set strict-ssl false
- ls -la
script:
- git config --global http.sslverify false
- npm config set @my-package:registry https://${TOKEN_USERNAME}:${TOKEN_PASSWORD}@HOST/PACKAGE/PACKAGE.git
- npm i git+https://${TOKEN_USERNAME}:${TOKEN_PASSWORD}@HOST/react.git#master
Dependecy 有 package.json 应该使用 `npm -i" 作为依赖安装:
package/mypackage: git+https://${TOKEN_USERNAME}:${TOKEN_PASSWORD}@HOST/react.git#master
一个问题是CI没有识别路径:
$ npm i git+https://${TOKEN_USERNAME}:${TOKEN_PASSWORD}@HOST/react.git#master
npm ERR! prepareGitDep 2> npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm ERR! prepareGitDep npm WARN tar ENOENT: no such file or directory, open '/root/.npm/_cacache/tmp/git-clone-7b8b3c6a/node_modules/.staging/uglify-js-ce069d2e/lib/compress.js'
【问题讨论】:
-
这个命令对你本地有用吗?
-
不,SSH 和 22 端口已关闭。
标签: npm continuous-integration gitlab