Skip to content

Commit

Permalink
package.json: Require npm 5.8
Browse files Browse the repository at this point in the history
npm 5.8 is the last known version to support --no-optional,
which avoids many unessential items in package-lock.json

As travis installs the npm version in package.json, and
uses `npm ci` instead of `npm install` when 5.8 is found,
override `install` to avoid `npm ci` failing because
'optional' `validate-npm-package-name` is not found.

Related to npm/npm#17633

Closes #28
  • Loading branch information
jayvdb committed Aug 1, 2018
1 parent 475f947 commit 333717b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ before_script:
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start

before_install:
- npm install --no-save --no-optional --only=dev [email protected]

install:
- npm install --no-save --no-optional

before_install:
# bufferstream in package-lock.json means optional dependencies
# have been included.
- if grep bufferstream package-lock.json ; then false; fi

script:
- script/build.sh
- npm run test
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"json-loader": "^0.5.4",
"less": "^2.7.1",
"less-loader": "^4.0.5",
"npm": "^5.8.0",
"npm-run-all": "^4.1.3",
"selenium-standalone": "^6.15.1",
"style-loader": "^0.18.2",
Expand Down Expand Up @@ -94,5 +95,8 @@
"ultramarked": "^1.7.0",
"underscore": "^1.8.3",
"unfetch": "^3.0.0"
},
"engines": {
"npm": "~5.8.0"
}
}

0 comments on commit 333717b

Please sign in to comment.