Skip to content

feat: pnpm should fail if the project needs another version#1914

Merged
zkochan merged 4 commits into
masterfrom
feat/1382
Jul 13, 2019
Merged

feat: pnpm should fail if the project needs another version#1914
zkochan merged 4 commits into
masterfrom
feat/1382

Conversation

@zkochan

@zkochan zkochan commented Jul 13, 2019

Copy link
Copy Markdown
Member

pnpm should fail if the project has an engines.pnpm field in its
package.json and the running pnpm's version does not satisfy the
range.

pnpm should also fail it the project has an engines.node field
and process.version does not satisfy it.

close #1382

@zkochan zkochan added this to the v3.6 milestone Jul 13, 2019
pnpm should fail if the project has an engines.pnpm field in its
package.json and the running pnpm's version does not satisfy the
range.

pnpm should also fail it the project has an engines.node field
and process.version does not satisfy it.

close #1382
@zkochan zkochan merged commit a7c4a27 into master Jul 13, 2019
@zkochan zkochan deleted the feat/1382 branch July 13, 2019 23:36
@Ten0

Ten0 commented Jul 17, 2019

Copy link
Copy Markdown

Owkay so I'm using node >10 to run packages that were designed for node 10 and more, and due to this change I can't install them anymore. How do we declare multiple compatible major versions in "engines", or is there a bypass switch ?

@zkochan

zkochan commented Jul 17, 2019

Copy link
Copy Markdown
Member Author

you have "engines": {"node": ">=10"} in package.json and it started failing?
Can you create a repo to reproduce?

@Ten0

Ten0 commented Jul 17, 2019

Copy link
Copy Markdown

Thanks, that indeed is the right syntax. :) (I meant by "I'm using node >10": "the version of node on my computer is strictly greater than 10")
I still have a need for packages that I don't own where the maintainer does not guarantee >11 compatibility to not have to install node 10 on my machine. Is there a bypass switch for this ?
If not, shouldn't we add one ?

@zkochan

zkochan commented Jul 17, 2019

Copy link
Copy Markdown
Member Author

Packages that you don't own? You mean dependencies inside node_modules? Those don't cause installations to fail unless you set the engine-strict config to true

@Ten0

Ten0 commented Jul 17, 2019

Copy link
Copy Markdown

Thanks for the quick answers! This behaviour is indeed mentionned in the documentation.
However I mean non-dependencies (a project workspace -~100 packages- I install using pnpm that is regularly updated so I can't just patch them everytime nor have them unclean in my git tree).

@zkochan

zkochan commented Jul 17, 2019

Copy link
Copy Markdown
Member Author

hm, I guess we can make this check a warning when engine-strict is false. But only the engines.node check

@Ten0

Ten0 commented Jul 18, 2019

Copy link
Copy Markdown

That would perfectly fit with my scenario! :)

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

Successfully merging this pull request may close these issues.

Examine 'engines.pnpm' in package.json

2 participants