Angular2... 4... 5... can't get it to work!

I’ve got a very simple Angular app I’m trying to set up a basic CI flow for but I can’t even get past the NPM install step. It appears as if I can’t get a hold of a docker image with Node > 4.6.x. Anyways, here’s the NPM install console readout

npm install

node-sass4.6.0 install /home/ubuntu/project-nest-webapp/node_modules/angular/cli/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.6.0/linux-x64-46_binding.node
Download complete
Binary saved to /home/ubuntu/project-nest-webapp/node_modules/angular/cli/node_modules/node-sass/vendor/linux-x64-46/binding.node
Caching binary to /home/ubuntu/.npm/node-sass/4.6.0/linux-x64-46_binding.node

node-sass-4.6.0 postinstall /home/ubuntu/project-nest-webapp/node_modules/angular/cli/node_modules/node-sass
node scripts/build.js

Binary found at /home/ubuntu/project-nest-webapp/node_modules/angular/cli/node_modules/node-sass/vendor/linux-x64-46/binding.node
Testing binary
Binary is fine
npm ERR! Linux 3.13.0-129-generic
npm ERR! argv “/opt/circleci/nodejs/v4.2.6/bin/node” “/opt/circleci/nodejs/v4.2.6/bin/npm” “install”
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package angular-devkit/schematics0.0.35 does not satisfy its siblings’ peerDependencies requirements!
npm ERR! peerinvalid Peer schematics/angular0.0.49 wants angular-devkit/schematics0.0.34

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/project-nest-webapp/npm-debug.log

npm install returned exit code 1

Action failed: npm install

And here’s my yaml file

version: 2
jobs:
build:
working_directory: ~/project-nest
docker:
- image: circleci/node:6-browsers
steps:
- checkout
- run:
name: update-npm
command: sudo npm install -g npm@latest
- restore_cache:
key: project-nest-{{ .Branch }}-{{ checksum “package.json” }}
- run:
name: install-dependencies
command: npm install
- save_cache:
key: project-nest-{{ .Branch }}-{{ checksum “package.json” }}
paths:
- ./node_modules
- run:
name: angular-test
command: xvfb-run -a npm run test – --single-run --no-progress --browser=ChromeNoSandbox

Any pointers would be awesome!

Could you use the basic Docker image and install the components/versions that you need manually?

Did this get resolved? I’ve encountered a simple issue. Driving me nuts!

npm ERR! peerinvalid The package @angular/common@5.1.2 does not satisfy its siblings’ peerDependencies requirements!

If I remember correctly, I used a blank image and manually installed all
the dependencies on the CI flow. It sucks, but it works.

1 Like

I turned to VSTS (Visual Studio Team Services) in the end. Found it easier
to use and it works without any hacks or workarounds.

Hi,

We’re using the Angular CLI and I think we had this issue with node-sass. We run npm rebuild node-sass as part of the sequence in our config file

    steps:
      - checkout

      - run:
          name: versions
          command: |
            node --version
            npm --version
            yarn --version

#      Download and cache dependencies
      - restore_cache:
          key: dependency-cache-{{ checksum "yarn.lock" }}

      - run:
          name: yarn-install
          command: yarn --no-progress --pure-lockfile

      - save_cache:
          key: dependency-cache-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
            - ./node_modules

      - run:
          name: rebuild node-sass
          command: npm rebuild node-sass

Hope this helps

Charlie

*Edit - we’re using this image:

    docker:
      # specify the version you desire here
      - image: circleci/node:8.9.3-browsers
2 Likes