• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

npm / cli
97%
latest: 97%

Build:
Build:
LAST BUILD BRANCH: nlf/arborist-validation
DEFAULT BRANCH: latest
Repo Added 03 Dec 2019 05:22PM UTC
Files 127
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH isaacs/fix-windows-shell-bins
branch: isaacs/fix-windows-shell-bins
CHANGE BRANCH
x
Reset
  • isaacs/fix-windows-shell-bins
  • +nlf/arborist-update
  • 6.4
  • MylesBorins-patch-1
  • PR-3542
  • assapir/redact-password
  • baj-/update-unpublish-docs
  • chore/npm-log
  • chore/reverse-docs-links-fix
  • christoflemke/update-publish-docs
  • darcyclarke-patch-1
  • darcyclarke-patch-2
  • darcyclarke-patch-3
  • darcyclarke-patch-npm-docs
  • darcyclarke-update-readme-with-branding-ref
  • darcyclarke/fix-broken-help-docs-ref
  • darcyclarke/pass-flatoptions-in-ci
  • darcyclarke/remove-extraneous-tough-cookie
  • darcyclarke/update-contribution-guidelines
  • darcyclarke/update-docs
  • darcyclarke/update-reademe
  • debug-npm-registry-fetch-logout-test
  • deps/arborist-2-10-0
  • deps/ci-detect-1-4-0
  • deps/node-gyp-8-3-0
  • deps/pacote-12-0-1
  • docs-npm-team
  • ethomson/docs
  • feature/improve-workspaces-docs
  • feature/test-checkout-v2
  • fetch-patch
  • fix/logs-url
  • fritzy/include-workspace-root
  • fritzy/scriptdocs-uninstall
  • fritzy/workspace-root
  • gar/404-log-http
  • gar/_auth
  • gar/alt-registry-auth
  • gar/always-exit-check
  • gar/audit-level-info
  • gar/bin-install-docs
  • gar/case-sensitive-node-modules
  • gar/changelog-manual-hiccup
  • gar/ci-audit-param
  • gar/ci_ignore_scripts
  • gar/clean-argv
  • gar/completion-refactor
  • gar/config-link
  • gar/config-noproxy
  • gar/config-snapshot
  • gar/config-tests
  • gar/creds-in-error
  • gar/diff-tests
  • gar/diff-workspaces
  • gar/diff-workspaces-refactor
  • gar/docs-lifecycle
  • gar/docs-npm
  • gar/docs-package-config
  • gar/docs-workspaces
  • gar/docs_prefix
  • gar/docs_search
  • gar/docs_shrinkwrap
  • gar/docs_start
  • gar/docs_stop
  • gar/docs_test
  • gar/docs_token
  • gar/docs_uninstall
  • gar/docs_unpublish
  • gar/dym-no-pkg
  • gar/exec-cache
  • gar/exec-output
  • gar/exec-test-fix
  • gar/exit-handler
  • gar/exit-handler-mark-two
  • gar/explicit-production
  • gar/fastest-levenshtein
  • gar/fix-case-sensitive-snafu
  • gar/fix-preinstall
  • gar/flatoptions
  • gar/git-error-cleanup
  • gar/help-search
  • gar/hooks-docs
  • gar/index-js
  • gar/init-cache
  • gar/init-latest
  • gar/install-audit-level
  • gar/install-no-rm
  • gar/install-progress-bar
  • gar/install-save-exact
  • gar/latest-npm-issue-template
  • gar/lifecycle-cmd-refactor
  • gar/linting
  • gar/login-scope
  • gar/loglevel-background
  • gar/mock-npm-config
  • gar/more-real-tests
  • gar/no-exit-handler
  • gar/node-12
  • gar/node-gyp-8
  • gar/npm-color
  • gar/npm-engines-check
  • gar/npm-load
  • gar/npm-output
  • gar/npm-pkg-typo
  • gar/npm-references
  • gar/npm-state
  • gar/npm-update-docs
  • gar/outdated-in-range
  • gar/pack-destination
  • gar/pack-name-version
  • gar/pack-workspaces
  • gar/parse-error-path
  • gar/preinstall
  • gar/pretty-bytes
  • gar/promisify
  • gar/publish-docs-fix
  • gar/publish-ignore-scripts
  • gar/publish-test-fix
  • gar/publish-tests
  • gar/publish-workspaces
  • gar/real-npm-mock
  • gar/rebuild-docs
  • gar/refactor-commands
  • gar/save-exact-prefix
  • gar/searchopts
  • gar/security-md
  • gar/silent-run-script
  • gar/stale-timings
  • gar/suggestions-cleanup
  • gar/tap15
  • gar/test-err-consistency
  • gar/test-help-coverage
  • gar/test-time-fix
  • gar/test-usage-snapshot
  • gar/undeprecate
  • gar/unknown-action-item
  • gar/unpublish-workspaces
  • gar/update-notifier-color
  • gar/usage
  • gar/usage-from-config
  • gar/user-agent-ci
  • gar/user-agent-config
  • gar/view-git-fix
  • gar/view-test-cleansnap
  • gar/view-workspaces
  • gar/view-ws-docs
  • gar/windows-open-url
  • gar/workspace-dot
  • gar/workspaces-consolidate-logic
  • gar/workspaces-docs
  • gar/workspaces-version
  • isaacs-gar/coverage-map-update
  • isaacs/2936
  • isaacs/add-env-export-false-flag-for-config-defs
  • isaacs/audit-handle-failed-endpoint
  • isaacs/audit-level-reify-exit-code
  • isaacs/auto-generate-cmd-config-docs-from-params
  • isaacs/auto-generated-docs-comment
  • isaacs/bash-to-sh
  • isaacs/better-script-escaping
  • isaacs/better-view-error-on-invalid-package-json
  • isaacs/broader-istanbul-ignore-in-help-search
  • isaacs/builtin-config-preservation
  • isaacs/ci-rm-timer
  • isaacs/ci-scripts
  • isaacs/cmd-env-fix
  • isaacs/config-refactor
  • isaacs/config-refactor-phase-2
  • isaacs/config-set-multi
  • isaacs/correct-usage-multiples
  • isaacs/default-command
  • isaacs/do-not-clobber-env-run-script
  • isaacs/doc-config-force-peer-deps-override
  • isaacs/docs-2020-12-10
  • isaacs/docs-lockfile
  • isaacs/eresolve-report-on-edge-if-node-missing
  • isaacs/explain-dep-name-missing-bugfix
  • isaacs/faster-make-publish-no-docs-clean
  • isaacs/fix-publish-tag
  • isaacs/foreground-scripts
  • isaacs/hide-easter-egg-better
  • isaacs/ini-2
  • isaacs/json-errors-to-stderr
  • isaacs/less-noisy-links-in-ls
  • isaacs/link-workspace
  • isaacs/locale-compare-en
  • isaacs/lockfile-version-config
  • isaacs/ls-ignore-missing-optionals
  • isaacs/ls-invalid-helpful-info
  • isaacs/ls-test-update-hidden-lock-file-mtime
  • isaacs/more-docs-human-error-prevention
  • isaacs/no-notifier-for-installing-npm-at-latest
  • isaacs/node-12
  • isaacs/pack-do-not-show-bundled-files
  • isaacs/parallelize-update-notifier
  • isaacs/prefix-over-local-prefix
  • isaacs/process-title
  • isaacs/publish-fail-when-no-registry-no-login
  • isaacs/publish-non-directories
  • isaacs/publishConfig-support-all-keys
  • isaacs/quieter-exec
  • isaacs/reify-workspaces
  • isaacs/release-v7.5.5-arborist-update
  • isaacs/remove-always-auth-config-def
  • isaacs/remove-process-umask
  • isaacs/restore-npm-command-flat-option
  • isaacs/set-node-env-production
  • isaacs/set-npm-command-to-canonical-command
  • isaacs/string-locale-compare
  • isaacs/trim-node-modules
  • isaacs/update-arborist-2.8.0
  • isaacs/use-files-list-in-package.json
  • isaacs/workspace-dot
  • isaacs/workspace-root
  • latest
  • lk/3881
  • lk/3962-shrinkwrap
  • lk/arborist-4.0.3
  • lk/cli-columns
  • lk/config-lockfile-version
  • lk/lint-test-on-command-refactor
  • lk/npmlog
  • lk/revert-workspace-root
  • lk/shrinkwrap-on-command-refactor
  • lk/test-gpg
  • lk/update-arborist
  • nlf/add-token-tests
  • nlf/add-workspaces-to-user-agent
  • nlf/arborist-update
  • nlf/arborist-validation
  • nlf/cache-tests
  • nlf/completion-tests
  • nlf/config-location
  • nlf/config-workspaces
  • nlf/curl-fix
  • nlf/delete-contents-not-dir
  • nlf/deprecate-tests
  • nlf/doctor-tests
  • nlf/dont-publish-more-files
  • nlf/edit-tests
  • nlf/explain-socket-timeout
  • nlf/fix-doctor-tests
  • nlf/fix-empty-scripts
  • nlf/fix-make-release
  • nlf/fix-npx-for-non-interactive-use
  • nlf/fix-proxy-outdated
  • nlf/fix-rebuild
  • nlf/fix-script-args
  • nlf/fix-some-flat-options
  • nlf/help-search-tests
  • nlf/help-tests
  • nlf/hook-tests
  • nlf/more-random-tests
  • nlf/no-error-for-extraneous-deps
  • nlf/no-global-dedupe
  • nlf/no-writefile-in-pack-tests
  • nlf/npx-run-existing-bins
  • nlf/org-tests
  • nlf/pacote-update
  • nlf/pass-publishConfig
  • nlf/remove-metrics
  • nlf/remove-require-from-string
  • nlf/remove-spawn-util
  • nlf/remove-unused-modules
  • nlf/restore-tag-prefix-on-version
  • nlf/restore-user-agent-env
  • nlf/search-opts
  • nlf/set-tests
  • nlf/skip-prompt-in-ci
  • nlf/stop-breaking-linked-packages
  • nlf/update-ci-detect
  • nlf/update-ci-workflow
  • nlf/update-install-script
  • nlf/workspaces-dist-tag
  • nlf/workspaces-set-script
  • olefriis-mistake-6.4
  • release-6.14.9
  • release-next
  • release-v6.14.10
  • release-v6.14.11
  • release/7.0.0
  • release/7.2.1
  • release/7.5.1
  • release/7.5.6
  • release/v6.14.12
  • release/v6.14.13
  • release/v6.14.14
  • release/v6.14.15
  • release/v6.14.16
  • release/v7.0.0
  • release/v7.0.0-rc.3
  • release/v7.0.0-rc.4
  • release/v7.0.0-staging
  • release/v7.0.0-staging-isaacs
  • release/v7.0.1
  • release/v7.0.10
  • release/v7.0.11
  • release/v7.0.12
  • release/v7.0.13
  • release/v7.0.14
  • release/v7.0.15
  • release/v7.0.2
  • release/v7.0.3
  • release/v7.0.4
  • release/v7.0.5
  • release/v7.0.6
  • release/v7.0.7
  • release/v7.0.8
  • release/v7.0.9
  • release/v7.1.0
  • release/v7.1.1
  • release/v7.1.2
  • release/v7.10.0
  • release/v7.11.0
  • release/v7.11.2
  • release/v7.12.0
  • release/v7.12.1
  • release/v7.13.0
  • release/v7.14.0
  • release/v7.15.0
  • release/v7.15.1
  • release/v7.16.0
  • release/v7.17.0
  • release/v7.18.0
  • release/v7.18.1
  • release/v7.19.0
  • release/v7.19.1
  • release/v7.2.0
  • release/v7.20.0
  • release/v7.20.1
  • release/v7.20.2
  • release/v7.20.3
  • release/v7.20.4
  • release/v7.20.5
  • release/v7.20.6
  • release/v7.21.0
  • release/v7.21.1
  • release/v7.22.0
  • release/v7.23.0
  • release/v7.24.0
  • release/v7.24.1
  • release/v7.24.2
  • release/v7.25.0
  • release/v7.3.0
  • release/v7.4.0
  • release/v7.4.1
  • release/v7.4.2
  • release/v7.4.3
  • release/v7.5.0
  • release/v7.5.2
  • release/v7.5.3
  • release/v7.5.4
  • release/v7.5.5
  • release/v7.5.6
  • release/v7.6.0
  • release/v7.6.1
  • release/v7.6.2
  • release/v7.6.3
  • release/v7.7.0
  • release/v7.7.1
  • release/v7.7.2
  • release/v7.7.3
  • release/v7.7.4
  • release/v7.7.5
  • release/v7.7.6
  • release/v7.8.0
  • release/v7.9.0
  • release/v8.0.0
  • release/v8.1.0
  • release/v8.1.1
  • release/v8.1.2
  • ruyadorno/npm-diff
  • ruyadorno/npm-pkg
  • support-virtual-listing
  • unpublished-by-undefined
  • update-policy-urls-v7
  • v6
  • v7
  • voxpelli-patch-1

pending completion
#1426

push

ruyadorno
Get correct npm prefix on all Windows unix shells

1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might
   be dash or some other shell)
2. Use Unix-style line endings, not Windows-style (Cygwin accepts
   either, but mingw bash sometimes objects, and WSL bash always does)
3. Test against paths using wslpath if available, but still pass win32
   paths to node.exe, since it is a Windows binary that only knows how
   to handle Windows paths.

This makes npm as installed by the Node.js Windows MSI installer behave
properly under WSL, Cygwin, MINGW Git Bash, and the internal MINGW Git
Bash when posix CLI utilities are exposed to the cmd.exe shell.

The test is not quite as comprehensive as I'd like.  It runs on the
various Windows bash implementations if they are found in their expected
locations, skipping any that are not installed.  Short of shipping
mingw, cygwin, and wsl as test fixtures, I'm not sure how we could do
much better, however.  At least, we can use this test to assist debug
and catch issues on Windows machines (ours or users who report
problems).

PR-URL: https://github.com/npm/cli/pull/2789
Credit: @isaacs
Close: #2789
Reviewed-by: @nlf

2857 of 2948 branches covered (96.91%)

Branch coverage included in aggregate %.

4761 of 4884 relevant lines covered (97.48%)

18.86 hits per line

Relevant lines Covered
Build:
Build:
4884 RELEVANT LINES 4761 COVERED LINES
18.86 HITS PER LINE
Source Files on isaacs/fix-windows-shell-bins
  • Tree
  • List 117
  • Changed 80
  • Source Changed 80
  • Coverage Changed 80
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
#1426 isaacs/fix-windows-shell-bins Get correct npm prefix on all Windows unix shells 1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash ... push 04 Mar 2021 09:09PM UTC ruyadorno pending completion  
#1396 isaacs/fix-windows-shell-bins tests: pass tests on Windows without Admin privs 1. Skip testing Cygwin bash shim when coverage is enabled, since this doesn't work, and probably never will. 2. Create symbolic links to directories rather than files, so that Administrative ... push 01 Mar 2021 10:35PM UTC isaacs pending completion  
#1379 isaacs/fix-windows-shell-bins fixup! fixup! Get correct npm prefix on all Windows unix shells push 26 Feb 2021 10:10PM UTC isaacs pending completion  
#1377 isaacs/fix-windows-shell-bins fixup! Get correct npm prefix on all Windows unix shells push 26 Feb 2021 10:08PM UTC isaacs pending completion  
#1375 isaacs/fix-windows-shell-bins Get correct npm prefix on all Windows unix shells 1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash ... push 26 Feb 2021 10:05PM UTC isaacs pending completion  
#1374 isaacs/fix-windows-shell-bins Get correct npm prefix on all Windows unix shells 1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash ... push 26 Feb 2021 09:55PM UTC isaacs pending completion  
#1372 isaacs/fix-windows-shell-bins Get correct npm prefix on all Windows unix shells 1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash ... push 26 Feb 2021 09:50PM UTC isaacs pending completion  
See All Builds (3959)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc