How do to solve Angular Heroku ng build problem

Viewed 28

hi I am trying to deploy my angular application on heroku and Iam getting this error "An unhandled exception occurred: Could not find the implementation for builder @angular-devkit/build-angular:browser See "C:\Users\KEVINK~1\AppData\Local\Temp\ng-3xIfUM\angular-errors.log" for further details. npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file C:\WINDOWS\system32\cmd.exe npm ERR! errno ENOENT npm ERR! ng-pi-admin@0.0.0 build: ng build --base-href ./ npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the ng-pi-admin@0.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Kevin Kwabena Fia\AppData\Roaming\npm-cache_logs\2022-09-05T21_54_34_004Z-debug.log"

this is my //Install express server

const express = require('express');
const path = require('path');

const app = express();

// Serve only the static files form the dist directory
app.use(express.static('./dist/ng-pi-admin'));

app.get('/*', (req, res) =>
    res.sendFile('index.html', {root: 'dist/ng-pi-admin/'}),
);

// Start the app by listening on the default Heroku port
app.listen(process.env.PORT || 8080); code 
//Install express server
const express = require('express');
const path = require('path');

const app = express();

// Serve only the static files form the dist directory
app.use(express.static('./dist/ng-pi-admin'));

app.get('/*', (req, res) =>
    res.sendFile('index.html', {root: 'dist/ng-pi-admin/'}),
);

// Start the app by listening on the default Heroku port
app.listen(process.env.PORT || 8080);

package.json

{
  "name": "ng-pi-admin",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "node server.js",
    "build": "ng build --base-href ./",
    "build:prod": "ng build --prod --base-href ./",
    "build:ci": "ng build --prod --base-href ./",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "heroku-postbuild": "ng build"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.16",
    "@angular/common": "^7.2.10",
    "@angular/compiler": "^7.2.10",
    "@angular/core": "^7.2.10",
    "@angular/forms": "^7.2.10",
    "@angular/http": "^7.2.10",
    "@angular/platform-browser": "^7.2.10",
    "@angular/platform-browser-dynamic": "^7.2.10",
    "@angular/router": "^7.2.10",
    "angular-froala-wysiwyg": "^2.9.3",
    "animate.css": "^3.5.2",
    "bootstrap": "^3.3.7",
    "core-js": "^2.5.4",
    "echarts": "^3.8.5",
    "font-awesome": "^4.7.0",
    "fontface-source-sans-pro": "^2.0.10-alpha1",
    "framer-motion": "^6.3.11",
    "html-to-pdfmake": "^2.4.4",
    "jquery": "^3.2.1",
    "jspdf": "^2.5.1",
    "moment": "^2.29.3",
    "ng2-file-upload": "^1.3.0",
    "ng2-select": "^2.0.0",
    "ngx-echarts": "^2.0.0",
    "ngx-modal": "^0.0.29",
    "ngx-pagination": "^3.0.3",
    "ngx-toastr": "^10.1.0",
    "node-sass": "^4.12.0",
    "normalize.css": "^7.0.0",
    "pdfmake": "^0.2.5",
    "pell": "^1.0.4",
    "roboto-fontface": "^0.8.0",
    "rxjs": "^6.4.0",
    "rxjs-compat": "^6.0.0-rc.0",
    "sweetalert2": "^7.6.3",
    "tslib": "^1.14.1",
    "underscore": "^1.13.4",
    "zone.js": "~0.8.26",
    "@angular/cli": "^7.3.6",
    "@angular/compiler-cli": "^13.1.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.13.10",
    "@angular/cli": "^13.1.2",
    "@angular/compiler-cli": "^7.2.10",
    "@angular/language-service": "^7.2.10",
    "@types/jasmine": "~2.8.8",
    "@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-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "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"
  },
  "engines": {
    "node": "14.17.6",
    "npm": "8.5.5"
  }
}
0 Answers
Related