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
pnpm 7.20.0 and later should maybe log which config file is changed when doing "pnpm config set" #5877
Comments
I am sorry that it caused trouble. The issue is that in the past we did not have a config command. pnpm was passing through the config command to npm. Only v7.20 got its own implementation of the If |
Thanks for the quick reply @zkochan! Yes, confirmed. Doing a |
Confirming what @stoyle is saying as well. Running |
I have tested with npm CLI. In my case it also created a |
Doesn't seem to do it with 8.5.5 for me. Maybe in npm v9? Although, since you're saying it's the normal behavior now given npm does that too (for you), I changed my call with pnpm to set the global option to make sure to update the global config instead of a new "local" one |
This issue sounds like what's causing me some grief with my Azure DevOps setup. We're using self-hosted agents using Microsoft's Packer templates for base image creation. Then I install pnpm globally via npm within that image. This worked well up until recently. Now the command Versions used: |
@zkochan Wanted to say that our Azure Pipelines builds have also stopped working since this. I have a thread going here with trying out different workarounds, but so far we haven't figured out anything that works. Let me know if there is anything we should try out. Our pipelines steps can be seen in the post (replicated here for ease):
which is mostly as per the integrations steps, and confirmed works all the way up to v7.19.0 |
@marchy I'm sorry if if my question is dumb. Is'nt the latest |
@gethari not dumb at all, it was purely because this was the command listed on the Continuous Integration docs page, and there was a question asked about this but it was apparently working regardless of the PNPM version specified. HOWEVER... it seems the docs were just updated to now use 'corepack' instead – so this part of the puzzle at least is now moot.
The original issue is still not working however, getting the following message in the Install PNPM step:
@zkochan (!!) Unfortunately the prior workaround to use the 6.19.0 version (before the new config command was introduced) has now also stopped working. This has turned into a P1 issue as we cannot deploy our builds at all anymore – and the fallback to the old version is now not working anymore 🔥 Can we chase down why the |
I don't understand why you cannot deploy without caching the store. Caching the store is not required. TBH, the job might be faster without caching the store. |
@zkochan is that an option? What would be the commands to do that? There are no such instructions in the docs – and for sure, if it isn't necessary the build agent gets reset anyways between runs so there is no benefit to caching among runs |
I assume you need to remove parts related to cache. Something like this steps:
- script: |
corepack enable
corepack prepare pnpm@latest-7 --activate
displayName: "Setup pnpm"
- script: |
pnpm install
pnpm run build
displayName: "pnpm install and build" |
@zkochan this is still not working for me either in Azure DevOps, but in my case using Ubuntu runners. Same general steps. Caching is important to us as we're dealing with a bit of a large mono-repo for builds. I just switched this week to use corepack, but still having the same issue were Set is not updating the store path. This started when pnpm was updated to use it's own config setup, rather than using npm's in the background.
|
OMG that worked. So many days spent chasing this *head slap* Really appreciate the super prompt replies @zkochan. Could we please update the docs to mention that the caching is an optional step that is only useful for local build agents? (ie: not cloud agents which are ephemeral and clear out the file system image between builds anyways) |
I am changing where @marchy we can update the docs. @egg-r I don't know why that doesn't work. Maybe try to use |
@egg-r in my case the store is changed:
|
What exactly is "completed in #6132"? The original request was to implement logging of the excact destination where the changes go. Was that implemented? |
So not really a bug, but still wanted to tell people about it, since this gave us quite a headache when deploying.
Long story short, pnpm 7.20.0 and later makes modifications to local .npmrc file when doing
config set
, and that may not always be what you want. For instance if overriding store default. E.g.pnpm config set store-dir /home/travis/.cache/.pnpm-store
. Before 7.20.0 this was done in the global settings file, e.g. ˙~/.npmrc` on my machine.We use travis for builds, and most of the build is outside docker. But the final artifact is inside docker. In order to only have relevant artifact we use docker
COPY
and .dockerignore to get the right things in. This means we copy over .npmrc. However when we run thepnpm config set store-dir /home/travis/.cache/.pnpm-store
on the travis instance, the modified file is copied into docker.We may have a non-standard setup. But we are many in our org which uses it, and we had some trouble debugging it.
I am not sure this is a great idea, up to the project of course. But logging which file is changed when doing a
pnpm config set ...
probably would have helped us debug this a lot faster.Love pnpm, keep up the great work!
For reference, the errors we got were of the following sort (if people search for solutions):
The text was updated successfully, but these errors were encountered: