Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"401 Unauthorized" build error #179

Closed
planet36 opened this issue Dec 12, 2022 · 7 comments
Closed

"401 Unauthorized" build error #179

planet36 opened this issue Dec 12, 2022 · 7 comments

Comments

@planet36
Copy link
Contributor

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
Copy link
Member

roosta commented Dec 13, 2022

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
Copy link
Contributor Author

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
Copy link
Member

roosta commented Dec 13, 2022

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
Copy link
Member

roosta commented Dec 13, 2022

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 roosta closed this as completed Dec 23, 2022
@roosta roosta reopened this Jan 2, 2023
@roosta
Copy link
Member

roosta commented Jan 2, 2023

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
Copy link
Member

roosta commented Feb 3, 2023

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
Copy link
Contributor Author

planet36 commented Feb 4, 2023

It works now. Thanks!

@planet36 planet36 closed this as completed Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants