lathonez / clicker

Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
http://lathonez.com/2018/ionic-2-unit-testing/
MIT License
430 stars 136 forks source link

Dependency issues on CircleCI #163

Closed m5rk closed 8 years ago

m5rk commented 8 years ago

One of the dependencies installed here has an indirect dependency on npm 2.x:

http://lathonez.github.io/2016/ionic-2-unit-testing/

angular-cli depends on an old version of ember-cli which depends on on old version of npm. I can't get my project to build on CircleCI without clearing the cache. I'm trying to use the recommended Node v6.x, which by default uses npm v3.x. So my circle.yml looks like this:

machine:
  node:
    version: 6.9.1

The first time the project is built on CircleCI, when node_modules is empty because it hasn't been cached yet, the effective version of npm is v3.x. So npm install works. But that adds npm v2.x to node_modules/.bin. Which is then cached. And subsequent builds then use that version of npm for npm install, which fails. CircleCI puts node_modules/.bin first before the global node bin in $PATH.

I'm not sure how to resolve this.

m5rk commented 8 years ago

I resolved it like this:

# circle.yml
machine:
  node:
    version: 6.9.1

dependencies:
  override:
    - npm install:
        environment:
          PATH: $NVM_BIN:$PATH
lathonez commented 8 years ago

Thanks for this.