fix: show warning when path contains delimiter (#6606)#259
Open
MRagunandhan24 wants to merge 5 commits intonpm:mainfrom
Open
fix: show warning when path contains delimiter (#6606)#259MRagunandhan24 wants to merge 5 commits intonpm:mainfrom
MRagunandhan24 wants to merge 5 commits intonpm:mainfrom
Conversation
wraithgar
reviewed
Jan 21, 2026
lib/set-path.js
Outdated
| if (binPaths) { | ||
| for (const bin of binPaths) { | ||
| if (bin.includes(delimiter)) { | ||
| log.warn('exec', 'Project path contains delimiter (":"), npx may not behave as expected.') |
Member
There was a problem hiding this comment.
This is not npx, this is used in other places. We will need to make the message more generic to cover all use cases (npm exec, npm run).
Author
There was a problem hiding this comment.
Thank you for the input ! , Now I've modified the message to include the event that triggered this warning to provide useful information. Requesting your feedback on this.
wraithgar
reviewed
Feb 3, 2026
| // guaranteed, nor is it guaranteed to be the only one. Merge them | ||
| // all together in the order they appear in the object. | ||
| const setPATH = (projectPath, binPaths, env) => { | ||
| const setPATH = (projectPath, binPaths, env, event) => { |
Member
There was a problem hiding this comment.
We are already carrying event in env.npm_lifecycle_event. We should pull it from there, instead of passing it in a second context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
This pull request is aimed at npm/cli#6606. Currently if the project path includes a colon npx and npm exec will fail to find installed packages with no explanation.
Solution:
Added a warning message so that people can understand about the delimiter present in the path.
References