How can I install a specific node.js version on a PHP container on Travis CI?

折月煮酒 提交于 2020-01-13 10:34:06

问题


For a Laravel project I use Travis Ci with the language option as PHP. Besides PHP I want to do some Node JS testing. The default installed version of Node JS does not meet my requirements. How can I specify the version of Node JS in my config file?

I have tried the following. But unfortunately, that does not work.

language: php

php:
  - '7.0'
  - '7.1'

node_js:
  - '6.10'

回答1:


In search for an answer to the same question I ended up here, and there, and this helped me:

language: php

php:
  - 7.0
  - 7.1

before_install:
  - nvm install 6.10

install
  - npm install

Note: Installing this in the before_install section as I am installing the actual packages in the install section.



来源:https://stackoverflow.com/questions/44249044/how-can-i-install-a-specific-node-js-version-on-a-php-container-on-travis-ci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!