Angular デプロイの流れ 忘備録
Angular デプロイの流れ
- herokuでは package.jsonをインストールするだけ
- post install ->ビルドが通る -npm start が実行される
- expressのサーバーが起動される Railsのpumaのようなイメージ -ルーティングはexpressがしている
- 表示したあとのruotingはAngularがしている
npm start はrails sのイメージ
nodeのバージョンが違うのにexpressをinstall したのが原因?
かなり環境が汚れてしまった。
//cacheをクリヤしなさいというので npm cache clean 404 npm cache verify //angularのバージョンが違うのでglobalにインストール 405 npm install -g @angular/cli 406 npm install 407 git status 408 git add . 409 git commit -m "fix dependency" 410 ng -v 411 npm update --help //updateしたけどうまくいかない 412 npm update --save ng 413 ng -v //ローカルのangularをuninstall 414 npm uninstall @angular/cli --save //ローカルに再度install 415 npm install --save @angular/cli 416 ng -v 417 npm install 418 git add . 419 git commit -m "reinstall angular" //依存関係がおかしくてcodelyzerがインストールされていないので、ローカルにinstall 422 npm install --save codelyzer //lint コンパイル出来るようになった 423 ng lint 424 git status 425 git add . 426 git commit -m "npm install codelyzer" //herokuへデプロイ 427 git push heroku heroku-deploy:master 428 heroku -v 429 history