先日、AngularドキュメントサイトのソースをGitHubからクローンしてDockerで動かしてみる。という記事を投稿しましたが、実験中に出くわしたエラーメッセージがありました。
Dockerを使わずにローカルで動作させる場合にも関係する現象です。
AngularドキュメントサイトのREADME.mdに従って下記のコマンドを実行すると、下記のようなメッセージが表示されて処理が中断されました。
bash-4.2# yarn start
yarn start v0.23.4
$ yarn check-env && ng serve
yarn check-env v0.23.4
$ node ../tools/check-environment.js
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Your environment is not in a good shape. Following issues were found:
!!! - Looks like you are missing some npm dependencies. Run: npm install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your environment doesn't provide the prerequisite dependencies.
Please fix the issues listed above and then rerun the gulp command.
Check out https://github.com/angular/angular/blob/master/DEVELOPER.md for more info.
error Command failed with exit code 1.
error Command failed with exit code 1.
bash-4.2#
原因は、aioフォルダの上の階層のフォルダにもpackage.json
があり、事前にこちらに対してもnpm installを実行しておく必要がある、ということでした。
ローカルでドキュメントサイトを動作させる場合には、以下のような流れとなります。
git clone https://github.com/angular/angular.git
cd angular
npm install
cd aio
yarn
yarn docs
yarn start