This has been super helpful for me, thank you! It got me past a bunch of blockers and made a lot of things clear that I didn't understand before.
I am still hitting one last issue, though: when I try to yarn add my package with yarn add @mygithubusername/mypackage I get a 401 unauthorised error even though I'm using the same PAT as I used to publish it, which has both read and write permissions for packages.
Have you experienced this by any chance?
Thanks again!
EDIT: for anyone else who has this issue in the future, the problem is with yarn. npm works fine! Something to do with yarn and private packages.
Hey @hollg
, a few questions to give me a bit more context and make sure we're not missing anything obvious:
Has the package been published to a repository belonging to you? E.g. mygithubusername/project-a containing @mygithubusername/package-a.
As this is an authorization issue, it's possibly related to the configuration of the .npmrc file. Does your local clone of the repository in which you want to yarn add @mygithubusername/package-a (e.g. mygithubusername/project-b) contain a .npmrc file that looks something like this?:
Has the package been published to a repository belonging to you? E.g. mygithubusername/project-a containing @mygithubusername/package-a.
Yep, that's right
Does your local clone of the repository in which you want to yarn add @mygithubusername/package-a (e.g. mygithubusername/project-b) contain a .npmrc file that looks something like this?
It sure does!
Just to give you full context:
I'm working in a private repository hosted on my github account, with this setup:
client
some stuff
some other stuff
server
even more stuff
packages
shared-types
client and server have their own package.jsons managing their own dependencies, builds etc. But I want to share some TypeScript types between them. That's what shared-types is for. So I'm trying to yarn add it to client and server.
Thanks so much for taking the time to look into this with me!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This has been super helpful for me, thank you! It got me past a bunch of blockers and made a lot of things clear that I didn't understand before.
I am still hitting one last issue, though: when I try to
yarn add
my package withyarn add @mygithubusername/mypackage
I get a 401 unauthorised error even though I'm using the same PAT as I used to publish it, which has both read and write permissions for packages.Have you experienced this by any chance?
Thanks again!
EDIT: for anyone else who has this issue in the future, the problem is with yarn. npm works fine! Something to do with yarn and private packages.
Hey @hollg , a few questions to give me a bit more context and make sure we're not missing anything obvious:
Has the package been published to a repository belonging to you? E.g.
mygithubusername/project-a
containing@mygithubusername/package-a
.As this is an authorization issue, it's possibly related to the configuration of the
.npmrc
file. Does your local clone of the repository in which you want toyarn add @mygithubusername/package-a
(e.g.mygithubusername/project-b
) contain a.npmrc
file that looks something like this?:I'm happy to hear that you found the article useful. Hopefully we can get this last issue resolved 👍
Yep, that's right
It sure does!
Just to give you full context:
I'm working in a private repository hosted on my github account, with this setup:
client
andserver
have their ownpackage.json
s managing their own dependencies, builds etc. But I want to share some TypeScript types between them. That's whatshared-types
is for. So I'm trying toyarn add
it toclient
andserver
.Thanks so much for taking the time to look into this with me!