pnpm icon indicating copy to clipboard operation
pnpm copied to clipboard

Feature request: provide a way to fix "no matching version found inside the workspace" automatically

Open MichaelKapustey opened this issue 3 years ago • 10 comments

I deal with this pretty often. Resolving merge conflicts in package.json may lead to incorrectly typed version of dependency. Would be nice, if, after displaying message ' No matching version found for [email protected] inside the workspace' pnpm install would continue with 'found 1.3.5 instead. Would you like to update and proceed? Yes/no'

MichaelKapustey avatar Mar 25 '22 16:03 MichaelKapustey

You may automatically fix such issues with:

pnpm update --workspace -r

We can probably add this to the error message. Implementing a prompt sounds good to me as well.

zkochan avatar Mar 31 '22 00:03 zkochan

not working image

vallerydelexy avatar Jan 13 '23 09:01 vallerydelexy

#metoo

Denny966 avatar Feb 01 '23 15:02 Denny966

not working image

+1

maxlxq avatar May 09 '23 10:05 maxlxq

Me too.

Azoraqua avatar May 27 '23 13:05 Azoraqua

Why don't you just use the workspace:*, workspace:~, or workspace:^ version spec to reference dependencies from the workspace? In that case the dependency will always be linked from the workspace and you'll never have to change this.

zkochan avatar May 27 '23 13:05 zkochan

Why don't you just use the workspace:*, workspace:~, or workspace:^ version spec to reference dependencies from the workspace? In that case the dependency will always be linked from the workspace and you'll never have to change this.

That would be the case if it worked, but for me (And apperantly a few others around here), it'll complain that the version mismatches or is not found at all. Which in turn prevents the use of pnpm almost altogether.

Azoraqua avatar May 27 '23 16:05 Azoraqua

I agree with the other comments. I'm not having this happen with a monorepo/workspace, I'm having this happen in general. I'm upgrading a library, and the newer version depends on a newer version of a previously installed library. the lockfile is preventing the upgrade.

craigmiller160 avatar Jul 24 '23 19:07 craigmiller160

Until we have a reproduction available we can't fix it

zkochan avatar Jul 24 '23 19:07 zkochan

Happy pnpm user here who ran into this issue.

@Azoraqua @craigmiller160 what are your version numbers? I'm using YYYY.MM.DD-SNAPSHOT for version numbering right now, as my modules are not quite ready for production.

This is what broke this process! It seems pnpm does some validation on the version number string - despite referencing it as "workspace:*" in my package.json.

I changed my version numbers to 0.1.0 and all was well. With guidance from PNPM on how they want this to work, I would be happy to patch.

dcchuck avatar Nov 12 '25 16:11 dcchuck