AWS CodePipeline do not work with Github NPM packages?

Viewed 264

I have an Angular webapp which is consuming from a library, this library at the same time is published as a private npm package to the github repository. Now my library project package.json looks like this:

{
  "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/"
  }
}

Also I have a .npmrc file localy for this project:

`//npm.pkg.github.com/:_authToken=PRIVATE_TOKEN

In the consumer project I have the library as a typical npm package:

 "@tihomir22/generales-wrapper-lib": "0.0.11",

And I have another .npmrc located on my home directory with the following config:

 @tihomir22:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=SECRET TOKEN

Now here it comes the tricky thing, when I install it locally, it installs without any problem and goes everything smooth, but, when I try to compile it by aws codepipeline it says me 404 not found =/:

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

As you may have noticed, it tries to find it on different registry, I guessed because the codepipeline dosnt have this .npmrc file which changes the registry, so I added on the consumer project itself. But then it gives me 401 Unauthorized.

What Im forgetting to do? What AWS needs to be done?

Thanks in advance!

0 Answers
Related