Local node incorrectly resolved on Windows
Nobody has claimed this yet.
- #42 by @connorjsmith — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start by reviewing the change in issue #26 and the cmd-shim entry points that generate Windows command scripts. Reproduce the local-node and PATH-node cases on Windows using the proposed command forms; done means local node paths still work while the fallback node command does not use unnecessary quotes.
Written by the indexing model from the issue text.
Description
Disclaimer: I am not that experienced with cmd scripting
After updating to the latest npm, some of our scripts broke. I traced this to the change in #26, which always quotes the executable name (even if it is just node). This seems to cause issues for some paths (The system cannot find the path specified.)
Proposed fix (using tslint as an example):
@ECHO off
SETLOCAL
CALL :find_dp0
SET _maybeQuote="
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET _maybeQuote=
SET PATHEXT=%PATHEXT:;.JS;=;%
)
%_maybeQuote%%_prog%%_maybeQuote% "%dp0%\..\tslint\bin\tslint" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
For the %dp0% case, this resolves to
"%dp0%\node.exe" "%dp0%\..\tslint\bin\tslint" %*
otherwise, it resolves to
node "%dp0%\..\tslint\bin\tslint" %*
Effectively, we only use quotes around the node executable when we use .bin\node.exe
- Dominant language
- JavaScript
- Stars
- 81
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from npm/cmd-shim
-
Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
[BUG] PowerShell shim generated as UTF-8 without BOM breaks on Windows PowerShell 5 with non-ASCII pathsPossibly taken @webywz claimed this 32 days ago. OpenNeeds Triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Needs Triage
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Priority 1
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Needs Triage
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Flow Needs: Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
react/react-native#60447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
erkamyaman/rust-anything#1153 ·
Maintainers usually reply within 1 day
-
Entity picker filter keeps the first kind's groups after switching Specific Term / Specific PostOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
davidofchatham/bws-gb-dynamic-tags-extensions#177 ·
Maintainers usually reply within 1 day
-
frontend good first issue kind:task level:starter size:s
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Arggon/ArggonStores#42 ·
Maintainers usually reply within 1 day
-
accessibility area: frontend area: i18n beginner-friendly bug difficulty: easy good first issue i18n keyboard priority: P3 quality user-experience
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day