Reputation: 23
I tried to compile my project in Travis CI with the following config:
language: node_js
node_js:
- 0.12
env:
global:
- NODE_ENV=production
before_install:
# - npm run init
before_script:
# - bower install
# - gulp
# - npm install
script:
- npm install -g bower
- npm install -g gulp
- gulp
- npm run lint
sudo: false
If I set in my config
- NODE_ENV=production
Then Travis CI will compile my project.
Upvotes: 1
Views: 1908
Reputation: 765
Travis CI does run npm install
automatically — I suspect the problem you're having is with NODE_ENV
and dependencies
and devDependencies
.
If NODE_ENV=production
, NPM will not install devDependencies
(as noted here: https://github.com/npm/npm/issues/6803). You need to make sure the dependencies you need are in the correct group:
NODE_ENV=production
: dependencies installed from dependencies
groupNODE_ENV=development
: dependencies installed from devDependencies
groupUpvotes: 8