[英]View errors VisualStudio 2019 Angular 8
Try cleaning Cache and Node_module.尝试清理 Cache 和 Node_module。
Follow below steps按照以下步骤操作
npm cache clean --force
npm cache clean --force
npm install
npm install
Hope this helps.希望这可以帮助。
Looks like you are setting a different port when serving the application.看起来您在为应用程序提供服务时设置了不同的端口。
The default port is 4200
.默认端口是
4200
。 to set a different port you should use --port portNumber
要设置不同的端口,您应该使用
--port portNumber
in your package.json file remove extra quotes from --port
and 1576
.在您的 package.json 文件中,从
--port
和1576
删除额外的引号。 it should be like this应该是这样的
ng lint && ng serve --port 1576
Run npm install
to make sure your node modules are up to date.运行
npm install
以确保您的节点模块是最新的。
If you see any error regarding node module please fix that.如果您看到有关节点模块的任何错误,请修复该错误。
you can also use ng serve
to serve the application or ng serve -o
to serve and open in the browsers.您还可以使用
ng serve
为应用程序ng serve
服务,或使用ng serve -o
在浏览器中提供服务和打开服务。
if you want to change default port from 4200 to 4400 then run ng serve --port 4400
如果要将默认端口从 4200 更改为 4400,则运行
ng serve --port 4400
if your package.json file has scripts like this.如果你的 package.json 文件有这样的脚本。
"scripts": {
"start": "ng lint && ng serve --port 1576"
}
then you can also serve the application with npm run start
然后您还可以使用
npm run start
为应用程序提供服务
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.