node.js - AWS CodePipeline 不适用于 Github NPM 包?
问题描述
我有一个从库中使用的 Angular webapp,该库同时作为私有 npm 包发布到 github 存储库。现在我的库项目 package.json 看起来像这样:
{
"name": "@tihomir22/generales-wrapper-lib",
"version": "0.0.11",
"peerDependencies": {
"@angular/animations": "~11.1.2",
"@angular/cdk": "~11.1.1-sha-fdacb22f2",
"@angular/common": "~11.1.2",
"@angular/compiler": "~11.1.2",
"@angular/core": "~11.1.2",
"@angular/forms": "~11.1.2",
"@angular/material": "~11.1.1-sha-fdacb22f2",
"@angular/platform-browser": "~11.1.2",
"@angular/platform-browser-dynamic": "~11.1.2",
"@angular/router": "~11.1.2"
},
"dependencies": {
"@m0t0r/ngx-slider": "^1.0.0",
"animejs": "^3.2.0",
"lodash-es": "^4.17.20",
"material-icons": "^0.5.3",
"ngx-cookie-service": "latest",
"tslib": "^2.0.0",
"uuid": "^8.3.1"
},
"devDependencies": {
"@types/uuid": "^8.3.0",
"@types/lodash-es": "latest"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
}
}
我也有这个项目的 .npmrc 文件本地化:
`//npm.pkg.github.com/:_authToken=PRIVATE_TOKEN
在消费者项目中,我将库作为典型的 npm 包:
"@tihomir22/generales-wrapper-lib": "0.0.11",
我的主目录中还有另一个 .npmrc,配置如下:
@tihomir22:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=SECRET TOKEN
现在,棘手的事情来了,当我在本地安装它时,它安装没有任何问题并且一切顺利,但是,当我尝试通过 aws codepipeline 编译它时,它说我找不到 404 =/:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@tihomir22%2fgenerales-wrapper-lib - Not found
npm ERR! 404
npm ERR! 404 '@tihomir22/generales-wrapper-lib@0.0.11' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'src'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-02-21T20_18_56_261Z-debug.log
您可能已经注意到,它试图在不同的注册表上找到它,我猜是因为代码管道 dosnt 有这个 .npmrc 文件会更改注册表,所以我添加了消费者项目本身。但后来它给了我 401 Unauthorized。
我忘了做什么?AWS 需要做什么?
提前致谢!
解决方案
推荐阅读
- matlab - 用for循环在matlab中绘制傅里叶级数
- android - 如何解析下面的 JSON 响应?
- c# - Solidworks API C#/VB.net 设置枚举属性
- ocr - 与 OCR 引擎模式一起使用时,Tesseract 4 无法加载任何语言 - “Legacy + LSTM 引擎”(--oem 2)
- regex - 带有制表正则表达式的 EOF
- android - 如何在 Android 9 上声明显式接收器
- xamarin.forms - 我如何在不去 xamarin 表单上的画廊的情况下拍摄实时照片?
- javascript - 对象如何在javascript中存储密钥
- javascript - 如何将嵌套的 JSON 获取到网格的 Ext JS 模型
- amazon-web-services - 如何启用读写亚马逊s3存储桶权限