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

Consider explicitly defining package manager version in package.json #205

Open
stefanobartoletti opened this issue May 16, 2024 · 0 comments

Comments

@stefanobartoletti
Copy link
Contributor

Consider adding an explicit entry for the required package manager and its version in package.json.

This greatly helps when using node from nvm and using corepack to auto-detect the package manager and keep the environment as close as possible to the source (and possibly prevent issues when resolving dependencies in the lockfile too).

For context, this is what I get when I try to run pnpm i

> pnpm i
! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing [email protected]+sha512.14e915759c11f77eac07faba4d019c193ec8637229e62ec99eefb7cf3c3b75c64447882b7c485142451ee3a6b408059cdfb7b7fa0341b975f12d0f7629c71195.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager

Scope: all 2 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +91 -61
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------
Progress: resolved 91, reused 82, downloaded 3, added 59, done
node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-demi: Running postinstall script, done in 103ms
Done in 3.5s

This should be as easy as adding a "packageManager": "[email protected]" entry to package.json (of course by correctly setting desired version/range)

Thanks :)

@stefanobartoletti stefanobartoletti changed the title Consider explicitly defining package manager verison in package.json Consider explicitly defining package manager version in package.json May 16, 2024
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

1 participant