From 333717bbabf7c84ac3e2211c81e136e7c1fd032b Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Thu, 26 Jul 2018 10:10:18 +0700 Subject: [PATCH] package.json: Require npm 5.8 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 https://github.com/npm/npm/issues/17633 Closes https://github.com/coala/gh-board/issues/28 --- .travis.yml | 11 +++++++++++ package.json | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9ff4c96b..1e6a8c44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 npm@5.8.0 + +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 diff --git a/package.json b/package.json index 9e894083..ce9607ae 100644 --- a/package.json +++ b/package.json @@ -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", @@ -94,5 +95,8 @@ "ultramarked": "^1.7.0", "underscore": "^1.8.3", "unfetch": "^3.0.0" + }, + "engines": { + "npm": "~5.8.0" } }