-
Notifications
You must be signed in to change notification settings - Fork 12k
Heroku Deployment Failing #4532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think you are having the same issue described here: #4207 (comment) |
Don't use ng serve outside of your computer :) Also, try disabling NODE_MODULES_CACHE: https://devcenter.heroku.com/articles/nodejs-support#cache-behavior Example package.json with scripts for Heroku (notice that I moved @angular/cli from dev and a few others so you can build on postinstall: {
"name": "c3po",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"e2e": "protractor",
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"pretest": "npm run lint",
"start": "node server.js",
"postinstall": "ng build --target=production -e ${NODE_ENV:-production} --aot",
"update": "ng update --style scss --prefix xc",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/cli": "1.0.0-beta.29",
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/compiler-cli": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"compression": "^1.6.2",
"core-js": "^2.4.1",
"express": "^4.14.0",
"path": "^0.12.7",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"typescript": "~2.0.3",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"codelyzer": "~2.0.0-beta.1",
"git-scripts": "^0.2.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"karma-threshold-reporter": "^0.1.15",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0"
},
"engines": {
"node": "6.x.x"
}
} Example server.js: const compression = require('compression');
const path = require('path');
const express = require('express');
const app = express();
const port = process.env.PORT || 8080;
// Gzip
app.use(compression());
// Run the app by serving the static files in the dist directory
app.use(express.static(__dirname + '/dist'));
// Start the app by listening on the default Heroku port
app.listen(port);
// For all GET requests, send back index.html so that PathLocationStrategy can be used
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname + '/dist/index.html'));
});
console.log(`Server listening on ${port}`); |
@intellix Thanks man! You're a life saver! Pardon my asking why |
It's developed to be used as a development server so:
And this line :D
|
@intellix Thanks, didn't see that in the documentation. |
It is possible to install the Had issues while |
@intellix, why the doc on the main webpage https://cli.angular.io/ is saying: ng serve
? |
@benoitmugnier because... that doc is massively outdated and we really should have updated it by now, but haven't yet. Please disregard that, with extreme prejudice. We should be updating it soon and that will go out. |
@filipesilva Can't wait for new documentation :) |
Ok thanks @filipesilva! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions.
Repro steps.
The log given by the failure.
The text was updated successfully, but these errors were encountered: