-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Bugthing that needs fixingthing that needs fixingDuplicateduplicate of another, existing issueduplicate of another, existing issueRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
I have prettier-plugin-packagejson
installed (which has [email protected]
as a dependency)
And trying to run npx [email protected]
because I want to use version 1.48, before this tragic PR was merged
But npx picks up version 1.51.0 which is in my local deps, and in PATH. But it's the wrong version.
Expected Behavior
npx should make sure that it's running version 1.48
, as requested.
Steps To Reproduce
- Make sure
sort-package-json
is not installed globally (npm rm sort-package-json
) - Make sure it's not in PATH:
which sort-package-json
should not return anything - Do
npm init
- Add these two scripts in
package.json
:"z": "should be last", "a": "should be first"
- Do
npm i prettier-plugin-packagejson
- Run
npx [email protected]
- Observe scripts still not sorted, because 1.51 was used (
cat package.json
, see "z" will be still before "a")
Optional:
- Remove local deps:
rm -rf ./node_modules/
- Run
npx [email protected]
again - Observe scripts are now sorted because 1.48 was used (
cat package.json
, see "a" will be before "z")
Environment
- OS: Ubuntu 20 (WSL)
- Node: 16.7.0
- npm: 7.19.0
joemaller
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingDuplicateduplicate of another, existing issueduplicate of another, existing issueRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release