srcery-colors / srcery-terminal

Srcery theme terminal configurations
MIT License
197 stars 17 forks source link

"401 Unauthorized" build error #179

Closed planet36 closed 1 year ago

planet36 commented 1 year ago

I don't have any experience working with nodejs or npm, so not sure if it's my fault, but I'm unable to perform a make.

$ npm --version

npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
npm WARN config location in the cache, and they are managed by
npm WARN config     [`cacache`](http://npm.im/cacache).
8.19.2

$ make list

node:internal/modules/cjs/loader:1042
  throw err;
  ^

Error: Cannot find module 'commander'
...

$ npm install commander

npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
npm WARN config location in the cache, and they are managed by
npm WARN config     [`cacache`](http://npm.im/cacache).
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/@srcery-colors/srcery-palette/1.0.2/57bedffc1e01582d6242ac0ad27af63d60ab105f - authentication token not provided

make node_modules and make give the same output as npm install commander.

roosta commented 1 year ago

Hi, you need a package read token configured to be able to download github packages. More here: https://github.com/srcery-colors/srcery-palette

planet36 commented 1 year ago

From this page https://github.com/srcery-colors/srcery-palette/pkgs/npm/srcery-palette, this command npm install @srcery-colors/srcery-palette@1.0.2 outputs

npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
npm WARN config location in the cache, and they are managed by
npm WARN config     [`cacache`](http://npm.im/cacache).
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@srcery-colors%2fsrcery-palette - Not found
npm ERR! 404
npm ERR! 404  '@srcery-colors/srcery-palette@1.0.2' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
roosta commented 1 year ago

Just making sure:

  1. you did create a read package token and added it to your personal npmrc?
  2. in the example above, did you run the install command from project root?
roosta commented 1 year ago

This isn't that user friendly, its a result of publishing package on github packages, I thought it would be a bit more seamless than it turned out. This package was intended for internal development so I figured github packages was a good fit, but I strongly consider just adding it to the npm registry.

roosta commented 1 year ago

k, github packages cause issues with CI also, which I should've figured. I'll either setup a secret or push to npm, not sure yet

roosta commented 1 year ago

Alright, took me a while but install issues should be solved now, I've published the package on npm. https://www.npmjs.com/package/@srcery-colors/srcery-palette CI passes so you shouldn't have any issues installing anymore

planet36 commented 1 year ago

It works now. Thanks!