0
votes

I have the following .travis.yml file to deploy my project on Travis CI:

language: node_js
node_js:
  - 'lts/*'
  - 'node'
  - '8'

before_install:
# package-lock.json was introduced in npm@5
  - '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
  - npm install -g greenkeeper-lockfile@1
install: npm install
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
after_success: npm run coverage
deploy:
  provider: npm
  email: [email protected]
  api_key: $NPM_TOKEN
  on:
    tags: true

And I need to pass the --tls-min-v1.0 argument to node_js lts/ and node. Can I do that in some way?

1

1 Answers

2
votes

You could specify your argument through the environment variable NODE_OPTIONS

language: node_js

env:
  global:
    - NODE_OPTIONS="--tls-min-v1.0"

node_js:
  - 'lts/*'
  - 'node'
  - '8'

before_install:
# package-lock.json was introduced in npm@5
  - '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
  - npm install -g greenkeeper-lockfile@1
install: npm install
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
after_success: npm run coverage
deploy:
  provider: npm
  email: [email protected]
  api_key: $NPM_TOKEN
  on:
    tags: true