Я пытаюсь интегрировать простой Angular-проект с CircleCi.Когда я запускаю тест ng, каждый тест проходит успешно, проект также работает нормально с ng serve, но когда я помещаю его в GitHub, CircleCi не проходит его из-за:
#! / Bin/ bash -eo pipefail xvfb-run -a ng test --browsers = ChromeNoSandbox - покрытие кода --watch = false
Не удалось найти модуль "@ angular-devkit / build-angular"из "/ home / circleci / my-project".Ошибка: не удалось найти модуль "@ angular-devkit / build-angular" из /home/circleci/my-project".
Здесь config.yml file
version: 2
jobs:
build:
working_directory: ~/my-project
docker:
- image: circleci/node:10.10.0-browsers
steps:
- checkout
- restore_cache:
key: AngularCircleCI-{{ .Branch }}-{{ checksum "package.json" }}
- run: sudo npm install -g @angular/cli
- save_cache:
key: AngularCircleCI-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- "node_modules"
- run: xvfb-run -a ng test --browsers=ChromeNoSandbox --code-coverage --watch=false
- run: xvfb-run -a npm run e2e --protractor-config=protractor-ci.conf.js
И protractor-ci.conf.js
const config = require('./protractor.conf').config;
config.capabilities = {
browserName: 'chrome',
chromeOptions: {
args: ['--no-sandbox']
}
};
exports.config = config;
package.json
{
"name": "grades-app-front",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.5",
"@angular/cdk": "^7.3.2",
"@angular/common": "^7.2.5",
"@angular/compiler": "^7.2.5",
"@angular/core": "^7.2.5",
"@angular/flex-layout": "^7.0.0-beta.23",
"@angular/forms": "^7.2.5",
"@angular/material": "7.3.0",
"@angular/platform-browser": "^7.2.5",
"@angular/platform-browser-dynamic": "^7.2.5",
"@angular/router": "^7.2.5",
"@fortawesome/angular-fontawesome": "^0.3.0",
"@fortawesome/fontawesome-free": "^5.7.2",
"@ngrx/effects": "^7.2.0",
"@ngrx/store": "^7.2.0",
"@ngrx/store-devtools": "^7.2.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.3.1",
"core-js": "^2.6.5",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.4.0",
"tslib": "^1.9.0",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.12.4",
"@angular/cli": "^7.2.4",
"@angular/compiler-cli": "^7.2.5",
"@angular/language-service": "^7.2.5",
"@types/core-js": "^2.5.0",
"@types/jasmine": "^2.8.16",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}
node.js version = v10.10.0 npm version= 6.4.1