Skip to content

Commit ba1fd57

Browse files
committed
chore: move old npm out of the way, do not mess with prefix
1 parent bd22cc7 commit ba1fd57

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,20 @@ os:
2525
- windows
2626

2727
before_install:
28+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm config set loglevel verbose ; fi
2829
# prevents windows error: npm ERR! ... git-sh-setup: file not found
2930
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=/c/PROGRA~1/Git/usr/bin:/c/PROGRA~1/Git/mingw64/libexec/git-core:$PATH ; fi
3031
# 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
32+
#- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NPM_CONFIG_PREFIX=c:\\npm_prefix PATH=/c/npm_prefix:$PATH; fi
3433
# workspaces require npm 7 or above
35-
- npm install -g npm@latest
34+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then ren `npm prefix -g`/node_modules/npm `npm prefix -g`/node_modules/npm_old && node `npm prefix -g`/node_modules/npm_old/bin/npm-cli.js i -g npm@latest ; fi
35+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then npm install -g npm@latest ; fi
3636
# 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
37+
#- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export NPM_CONFIG_PREFIX=""; fi
3838
# the default path is broken up with node 14 and npm 7 on Windows - https://github.com/npm/cli/issues/2665
39-
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=`npm prefix -g`:$PATH ; fi
39+
#- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=`npm prefix -g`:$PATH ; fi
4040
# allow windows to run scripts with node 14 and npm 7 (may not be necessary when node 14 is no longer lts)
4141
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm config set script-shell c:/PROGRA~1/Git/bin/bash.exe ; fi
42-
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm config set loglevel verbose ; fi
4342

4443
script: npx nyc -s npm run test -- -- -- -t node --bail
4544
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

0 commit comments

Comments
 (0)