I want to deploy my Angular Application to Cloud-Foundry.
Below you can find the current package.json located in my dist folder:
{
"name": "showroom-app",
"version": "0.0.0",
"engines": {
"node": "14.15.3",
"npm": "6.13.7"
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build && cp -r ./cf/* ./dist",
"test": "echo \"Error: no test specified\"",
"lint": "ng lint",
"e2e": "ng e2e"
},
"dependencies": {
"@angular/animations": "~9.1.0",
"@angular/cli": "~9.1.0",
"@angular/compiler-cli": "~9.1.0",
"@angular/common": "~9.1.0",
"@angular/compiler": "~9.1.0",
"@angular/core": "~9.1.0",
"@angular/forms": "~9.1.0",
"@angular/platform-browser": "~9.1.0",
"@angular/platform-browser-dynamic": "~9.1.0",
"@angular/router": "~9.1.0",
"karma-coverage": "^2.0.3",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.0",
"@angular/language-service": "~9.1.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "^3.0.3",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
}
}
My manifest.yml:
---
applications:
- name: npmPipeline
buildpack: https://github.com/cloudfoundry/nodejs-buildpack
memory: 2048MB
disk_quota: 2048MB
dea_next.staging_disk_limit_mb:
description: "Disk limit in MB for staging tasks"
default: 4096
instances: 1
timeout: 360
random-route: true
path: ./
After executing cf push within the dist folder, the following error occurs:
2021-01-05T14:44:50.87+0100 [APP/PROC/WEB/0] OUT > hello-world@0.0.0 start /home/vcap/app
2021-01-05T14:44:50.87+0100 [APP/PROC/WEB/0] OUT > ng serve
2021-01-05T14:44:51.53+0100 [APP/PROC/WEB/0] ERR The serve command requires to be run in an Angular project, but a project definition could not be found.
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR! errno 1
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR! hello-world@0.0.0 start: `ng serve`
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR! Exit status 1
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR!
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR! Failed at the hello-world@0.0.0 start script.
2021-01-05T14:44:51.54+0100 [APP/PROC/WEB/0] ERR npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-01-05T14:44:51.67+0100 [APP/PROC/WEB/0] ERR npm ERR! A complete log of this run can be found in:
2021-01-05T14:44:51.67+0100 [APP/PROC/WEB/0] ERR npm ERR! /home/vcap/app/.npm/_logs/2021-01-05T13_44_51_544Z-debug.log
I already followed this proposed solution by updating the @angular/cli, but nothing changed ..
Any idea how to approach this? Thank you! :)
Cheers, Matthias