当我尝试在本地运行从GitHub克隆的Angular文档网站时,遇到了错误的情况

不久前,我在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
广告
将在 10 秒后关闭
bannerAds