IanVS / prettier-plugin-sort-imports

An opinionated but flexible prettier plugin to sort import statements
Apache License 2.0
951 stars 21 forks source link

Cannot install module without yarn #116

Closed tanepiper closed 1 year ago

tanepiper commented 1 year ago

Your Environment

Describe the bug

On a fresh machine install, pulling out repo that has this dependency - it breaks the npm install as yarn is not on my device, but is expected for the build task:

npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /Users/tane.piper/.nvm/versions/node/v18.17.0/bin/node /Users/tane.piper/.nvm/versions/node/v18.17.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/tane.piper/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > @ianvs/prettier-plugin-sort-imports@4.1.0 prepare
npm ERR! > yarn run compile
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm ERR! sh: yarn: command not found
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /Users/tane.piper/.npm/_cacache/tmp/git-cloneM1893N
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c yarn run compile

To Reproduce

On a reasonably fresh machine, or without yarn, try install @ianvs/prettier-plugin-sort-imports

Expected behavior

To be able to install @ianvs/prettier-plugin-sort-imports without yarn. It also not clear which version of yarn I should install (1 or 2+)

Screenshots, code sample, etc

Error log

npm i @ianvs/prettier-plugin-sort-imports
npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /Users/tane.piper/.nvm/versions/node/v18.17.0/bin/node /Users/tane.piper/.nvm/versions/node/v18.17.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/tane.piper/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > @ianvs/prettier-plugin-sort-imports@4.1.0 prepare
npm ERR! > yarn run compile
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm ERR! sh: yarn: command not found
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /Users/tane.piper/.npm/_cacache/tmp/git-cloneR1yBiM
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c yarn run compile

Contribute to @ianvs/prettier-plugin-sort-imports

tanepiper commented 1 year ago

Never mind - when I dug into it, the prettier-plugin-sort-json in one of the subfolders was set to github:ianvs/prettier-plugin-sort-imports instead of the release version - so this was likely the cause