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

env vars in .npmrc are not read when doing pnpm i -r #2570

Closed
zkochan opened this issue May 21, 2020 · 1 comment
Closed

env vars in .npmrc are not read when doing pnpm i -r #2570

zkochan opened this issue May 21, 2020 · 1 comment
Labels
area: monorepo Everything related to the pnpm workspace feature type: bug
Milestone

Comments

@zkochan
Copy link
Member

zkochan commented May 21, 2020

I'll just piggy back on this issue since I'm also having issues with environment variables in the .npmrc file. My monorepo structure currently is like this

packages/
   front-end/
   back-end/

In front-end and back-end i have .npmrc files that have these lines:

modules-dir=../../../../../../../${USER_DIR}/.pnpm-cache/${REPO}/front-end/node_modules
virtual-store-dir=../../../../../../../${USER_DIR}/.pnpm-cache/${REPO}/front-end/node_modules/.pnpm

If my current working directory is either back-end or front-end and I do pnpm install everything works as expected (The environment variables get read).

But if my current working directory is packages and i do pnpm recursive install or pnpm install -r then the environment variables are not read.

Instead if creates the directories /$\{USER_DIR\}/.pnpm-cache/\$\{REPO\}/back-end and /$\{USER_DIR\}/.pnpm-cache/\$\{REPO\}/front-end.

So pnpm is reading the npmrc files but it didn't substitute the variables.

I'm fine doing pnpm install individually in each package but i read a comment from @zkochan somewhere that said that doing pnpm install -r will do things in parallel for all the packages if they point to the same store.

Originally posted by @jmlopez-rod in #2569 (comment)

@zkochan zkochan added area: monorepo Everything related to the pnpm workspace feature type: bug labels May 21, 2020
@jmlopez-rod
Copy link

Coming back to this issue since it is still present but at least it is easier to see thanks to the changes in the most recent versions of pnpm.

Screen Shot 2020-09-13 at 2 59 37 PM

As you can see from the screenshot, the env vars were not replaced. The -r flag is so tempting to use because it just makes sense to use it to add a package to all the repos at once instead of having to cd to each and execute the command.

JensDallmann added a commit to CoreMedia/ckeditor-plugins that referenced this issue Sep 10, 2021
JensDallmann added a commit to CoreMedia/ckeditor-plugins that referenced this issue Sep 10, 2021
JensDallmann added a commit to CoreMedia/ckeditor-plugins that referenced this issue Sep 10, 2021
zkochan added a commit that referenced this issue Nov 11, 2022
close #5604
close #2570

Co-authored-by: Zoltan Kochan <z@kochan.io>
@zkochan zkochan added this to the v7.16 milestone Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: monorepo Everything related to the pnpm workspace feature type: bug
Projects
None yet
Development

No branches or pull requests

2 participants