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

[BUG] npx --no/npm exec --no/npm exec --yes runs tool in different path than npx --yes or npx #8021

Open
2 tasks done
soteri-scottmmjackson opened this issue Jan 10, 2025 · 0 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@soteri-scottmmjackson
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

  1. Have a monorepo with a subdirectory containing JS and JSX source and a workspace package.json structure, using eslint ^5.16.0 as a dev-dependency.
  2. npx eslint --max-warnings=0 --ext .js --ext .jsx src/**/* - observed files found and linted
  3. npx --no eslint --max-warnings=0 --ext .js --ext .jsx src/**/* - observed "No files matching the pattern were found"
  4. npx --yes eslint --max-warnings=0 --ext .js --ext .jsx src/**/* - observed files found and linted
  5. npm exec --no eslint --max-warnings=0 --ext .js --ext .jsx src/**/* - observed "No files matching the pattern were found"
  6. npm exec --yes eslint --max-warnings=0 --ext .js --ext .jsx src/**/* - observed "No files matching the pattern were found"
  7. npm exec eslint --max-warnings=0 --ext .js --ext .jsx src/**/* - observed "No files matching the pattern were found"

Expected Behavior

  • eslint should be run in the directory npx or npm exec was run in, and files should be found and linted.
  • Even if this isn't true, at the least, PWD behavior should NOT be different depending on the --no/--yes flag presence, or depending on whether npx or npm exec is used.

Steps To Reproduce

Steps in "current behavior".

Environment

  • npm: 11.0
  • Node.js: 23.4.0
  • OS Name: macOS Sequoia 15.2
  • System Model Name: Macbook Pro
  • npm config:
; "builtin" config from /opt/homebrew/lib/node_modules/npm/npmrc

prefix = "/opt/homebrew"

; node bin location = /opt/homebrew/Cellar/node/23.4.0/bin/node
; node version = v23.4.0
; npm local prefix = /Users/scottjackson
; npm version = 11.0.0
; cwd = /Users/scottjackson
; HOME = /Users/scottjackson
; Run `npm config ls -l` to show all defaults.
@soteri-scottmmjackson soteri-scottmmjackson added Bug thing that needs fixing Needs Triage needs review for next steps labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

1 participant