Журнал сборки Heroku
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 12.6.1
engines.npm (package.json): 6.13.4
Resolving node version 12.6.1...
Could not find Node version corresponding to version requirement: 12.6.1
-----> Build failed
! No matching version found for Node: 12.6.1
Heroku supports the latest Stable version of Node.js as well as all
active LTS (Long-Term-Support) versions, however you have specified
a version in package.json (12.6.1) that does not correspond to
any published version of Node.js.
You should always specify a Node.js version that matches the runtime
you’re developing and testing with. To find your version locally:
$ node --version
v6.11.1
Use the engines section of your package.json to specify the version of
Node.js to use on Heroku. Drop the ‘v’ to save only the version number:
"engines": {
"node": "6.11.1"
}
https://help.heroku.com/6235QYN4/
! Push rejected, failed to compile Node.js app.
! Push failed
Пакет. json Файл
{
"name": "material-dashboard-angular",
"version": "2.4.0",
"license": "MIT",
"scripts": {
"heroku-postbuild": "ng build --prod",
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && ng serve -o"
},
"engines": {
"node": "v12.6.1",
"npm": "v6.13.4"
},
"private": true,
"dependencies": {
"@agm/core": "1.1.0",
"@angular/animations": "9.0.5",
"@angular/cdk": "9.1.1",
"@angular/cli": "^9.1.7",
"@angular/common": "9.0.5",
"@angular/compiler": "9.0.5",
"@angular/compiler-cli": "^9.0.5",
"@angular/core": "9.0.5",
"@angular/forms": "9.0.5",
"@angular/http": "7.2.16",
"@angular/material": "9.1.1",
"@angular/platform-browser": "9.0.5",
"@angular/platform-browser-dynamic": "9.0.5",
"@angular/platform-server": "9.0.5",
"@angular/router": "9.0.5",
"ajv": "6.12.0",
"angular-tilt": "^1.2.0",
"aos": "^2.3.4",
"arrive": "2.4.1",
"bootstrap": "4.3.1",
"bootstrap-material-design": "4.1.2",
"bootstrap-notify": "3.1.3",
"chartist": "0.11.2",
"classlist.js": "1.1.20150312",
"core-js": "3.1.3",
"express": "^4.17.1",
"googleapis": "40.0.0",
"hammerjs": "2.0.8",
"jquery": "^3.5.1",
"moment": "2.24.0",
"path": "^0.12.7",
"perfect-scrollbar": "1.1.0",
"popper.js": "1.15.0",
"rxjs": "6.5.2",
"rxjs-compat": "6.5.2",
"typescript": "3.7.5",
"vanilla-tilt": "^1.7.0",
"web-animations-js": "2.3.1",
"zone.js": "0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.901.7",
"@angular/cli": "^9.1.7",
"@angular/compiler-cli": "^9.0.5",
"@angular/language-service": "9.0.5",
"@types/bootstrap": "4.3.0",
"@types/chartist": "0.9.46",
"@types/googlemaps": "3.36.4",
"@types/jasmine": "3.3.13",
"@types/jquery": "3.3.29",
"@types/node": "12.0.7",
"codelyzer": "5.2.1",
"jasmine-core": "3.5.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.4.1",
"karma-chrome-launcher": "3.1.0",
"karma-cli": "2.0.0",
"karma-coverage-istanbul-reporter": "2.1.1",
"karma-jasmine": "3.1.1",
"karma-jasmine-html-reporter": "1.5.2",
"protractor": "5.4.3",
"ts-node": "8.6.2",
"tslint": "6.0.0",
"typescript": "3.7.5"
}
}
Сервер. js Файл
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(__dirname + '/dist/material-dashboard-angular'));
app.get('/*', function(req,res) {
res.sendFile(path.join(__dirname+
'/dist/material-dashboard-angular/index.html'));});
app.listen(process.env.PORT || 8080);
Я пытаюсь развернуть my Angular 9 Приложение для Heroku с использованием Github для развертывания. Однако после выполнения инструкций по установке с YouTube Heroku указывает, что мои номера версий сборки неверны для узла / npm, но я дважды проверил их с помощью командной строки npm -v
node -v
, и я получил тот же результат npm v6.13.4 и узел v12.6.1.