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

Dynamic .NPMRC not being reloaded for preinstall #8821

Open
sirshurak opened this issue Apr 26, 2022 · 3 comments
Open

Dynamic .NPMRC not being reloaded for preinstall #8821

sirshurak opened this issue Apr 26, 2022 · 3 comments

Comments

@sirshurak
Copy link

Yarn: v1.22.18
Terminal: PowerShell or Git Bash

Using AWS CodeArtifact to install some private components are getting not found because npmrc dynamic generated in preinstall is not being reloaded on install.

To reproduce: just create a dynamic .npmrc file on script preinstall, then call yarn install, yarn will throw 401 not found.

@buschco
Copy link

buschco commented Feb 2, 2023

I have the same issue on mac/linux. However, the next yarn install will work properly.

here is a related SO post https://stackoverflow.com/questions/71069112/yarn-re-load-or-pass-new-config-after-preinstall

@cishaw123
Copy link

I added this as my preinstall script

Where the code to login is in the preinstall.js file. Could use the AWS CLI command too.

"preinstall": "node preinstall.js && yarn install --ignore-scripts && yarn postinstall && exit 0"

@LazyCompiler
Copy link

LazyCompiler commented Aug 17, 2023

I faced the same issue. I printed the configuration using yarn config list during the preinstall stage, and everything appeared to be okay! It was very difficult to pinpoint the problem.
Also, yarn's generic 401 error message confused me and led me to many online discussions about token issues with the yarn.lock file.

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

4 participants