我的angular 6项目有一个詹金斯管道。 管道失败并显示以下错误: 在“ / var / lib / jenkins / workspace / sbAdmin”中找不到模块“ @ angular-devkit / build-angular”。
该库确实仅位于package.json的DevDependency部分,因此我理解为什么找不到它。因此,为解决该问题,我在上一步中安装了它(以及一些更有用的库)。仍然没有运气。 寻找任何技巧或示例来解决它。
pipeline {
agent any
stages{
stage('Preinstall') {
steps {
sh 'NOVE_ENV=prod'
sh 'npm install @angular/cli @angular/compiler-cli @angular-devkit/build-angular typescript'
}
}
stage('Install') {
steps {
sh 'npm install'
}
}
stage('Build') {
steps {
// sh 'npm run build'
sh 'npm run ng -- build --prod'
}
}
}
}
我收到错误消息:Could not find module "@angular-devkit/build-angular"
,即使之前有成功的安装步骤。
这是package.json:
{
"name": "sb-admin",
"version": "1.0.0",
"license": "MIT",
"author": "Amir Gilboa",
"description": "",
"angular-cli": {},
"engines": {
"node": "8.9.4",
"npm": "6.1.0"
},
"scripts": {
"ng": "ng",
"start": "ng serve --port 4201",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.3",
"@angular/common": "^6.1.3",
"@angular/compiler": "^6.1.3",
"@angular/core": "^6.1.3",
"@angular/forms": "^6.1.3",
"@angular/http": "^6.1.3",
"@angular/platform-browser": "^6.1.3",
"@angular/platform-browser-dynamic": "^6.1.3",
"@angular/router": "^6.1.3",
"@auth0/angular-jwt": "^2.0.0",
"@ng-select/ng-select": "^2.13.0",
"@tinymce/tinymce-angular": "^2.3.1",
"angular2-recaptcha": "^1.1.0",
"bcryptjs": "^2.4.3",
"bootstrap": "^4.1.3",
"core-js": "^2.5.7",
"express-jwt": "^5.3.1",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"jsonwebtoken": "^8.3.0",
"lodash": "^4.17.10",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"ng2-file-upload": "^1.3.0",
"ngx-bootstrap": "^3.0.1",
"ngx-slick": "^0.2.1",
"ngx-spinner": "^6.1.2",
"ngx-toastr": "^9.0.2",
"popper.js": "^1.14.4",
"primeicons": "^1.0.0-beta.10",
"primeng": "^6.1.2",
"rxjs": "^6.2.2",
"rxjs-compat": "^6.2.2",
"tether": "^1.4.4",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.7.4",
"@angular/cli": "^6.1.4",
"@angular/compiler-cli": "^6.1.3",
"@angular/language-service": "^6.1.3",
"@types/express": "^4.16.0",
"@types/jasmine": "^2.8.8",
"@types/jasminewd2": "^2.0.3",
"@types/node": "^10.7.1",
"chai": "^4.1.2",
"chai-http": "^4.0.0",
"codelyzer": "^4.4.4",
"concurrently": "^3.6.1",
"jasmine-core": "^3.2.1",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^3.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^1.3.0",
"mocha": "^5.2.0",
"nodemon": "^1.18.3",
"protractor": "^5.4.0",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^2.8.4"
}
}