Skip to content

Commit bd22cc7

Browse files
committed
chore: restore prefix
1 parent beff798 commit bd22cc7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ os:
2727
before_install:
2828
# prevents windows error: npm ERR! ... git-sh-setup: file not found
2929
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=/c/PROGRA~1/Git/usr/bin:/c/PROGRA~1/Git/mingw64/libexec/git-core:$PATH ; fi
30+
# change default prefix for windows - https://travis-ci.community/t/command-npm-i-g-npm-latest-fails/431/7
31+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then echo $NPM_CONFIG_PREFIX; fi
32+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NPM_CONFIG_PREFIX_ORIG=$NPM_CONFIG_PREFIX; fi
33+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NPM_CONFIG_PREFIX=c:\\npm_prefix PATH=/c/npm_prefix:$PATH; fi
3034
# workspaces require npm 7 or above
31-
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NPM_CONFIG_PREFIX=c:\\npm_prefix PATH="/c/npm_prefix:$PATH"; fi
3235
- npm install -g npm@latest
33-
# allow windows to run scripts with node 14 and npm 7 (may not be necessary when node 14 is no longer lts)
36+
# restore default prefix for windows - https://travis-ci.community/t/command-npm-i-g-npm-latest-fails/431/7
37+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NPM_CONFIG_PREFIX=$NPM_CONFIG_PREFIX_ORIG; fi
38+
# the default path is broken up with node 14 and npm 7 on Windows - https://github.com/npm/cli/issues/2665
3439
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=`npm prefix -g`:$PATH ; fi
40+
# allow windows to run scripts with node 14 and npm 7 (may not be necessary when node 14 is no longer lts)
3541
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm config set script-shell c:/PROGRA~1/Git/bin/bash.exe ; fi
3642
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm config set loglevel verbose ; fi
3743

0 commit comments

Comments
 (0)