Reputation: 3283
I have an angular 2 app which builds fine on my MAC. Here are the relevant versions:
@angular/cli: 1.0.0-beta.30
node: 7.6.0
os: darwin x64
@angular/cli: 1.0.0-beta.30
@angular/common: 2.4.9
@angular/compiler-cli: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
Today I created a heroku app and I have been trying to deploy the app on it using heroku CLI. I have followed the steps here to do so.
Although it compiles properly on my MAC, on heroku it gives many errors, the most common of which are something like:
ERROR in /tmp/build_56020fc9198e03c2d2338a818aaf8e5d/src/$$_gendir/app/admin/configuration/email-templates/email-template-form/email-template-form.component.ngfactory.ts (589,18): Property 'loadingOverlay' is private and only accessible within class 'BaseComponent'.
Here are the package versions in my package.json
:
"dependencies": {
"@angular/cli": "1.0.0-beta.30",
"@angular/common": "2.4.9",
"@angular/compiler-cli": "2.4.9",
"@angular/compiler": "2.4.9",
"@angular/core": "2.4.9",
"@angular/forms": "2.4.9",
"@angular/http": "2.4.9",
"@angular/platform-browser": "2.4.9",
"@angular/platform-browser-dynamic": "2.4.9",
"@angular/router": "3.4.9",
"@types/jquery": "^2.0.40",
"@types/node": "^6.0.62",
"rxjs": "^5.0.1",
"typescript": "2.0.10"
},
"devDependencies": {
"@angular/cli": "1.0.0-beta.30",
"@angular/compiler-cli": "2.4.9",
"@types/jasmine": "2.5.38",
"@types/jquery": "^2.0.40",
"@types/node": "^6.0.42",
"typescript": "2.0.10"
}
There are more, but I have included only the ones that are relevant.
Upvotes: 0
Views: 341
Reputation: 3283
I finally got a solution to this. Heroku caches all the NPM packages (it does the same for Bower.
If you deploy the app after changing the versions in the package.json
, heroku does not download the new versions, instead uses the cached ones.
To force Heroku to download the packages instead of using the cached ones, do this:
$ heroku config:set NODE_MODULES_CACHE=false
$ git commit -am 'disable node_modules cache' --allow-empty
$ git push heroku master
You can unset if after a successfull push, otherwise, after every push it will download all the packages listed in package.json.
$heroku config:set NODE_MODULES_CACHE=true
Upvotes: 1