npm start 如何在端口 8000 上运行服务器 [英] How npm start runs a server on port 8000

查看:30
本文介绍了npm start 如何在端口 8000 上运行服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近使用来自 github 的 angular-seed 文件夹进行 angular 应用程序开发.在之前的一些 angularjs 教程中,angular-seed 文件夹中有一个脚本文件夹和一个 server.js 文件,其中包含运行节点服务器的所有配置.那么 npm 现在是如何开始运行一个节点服务器的,那个节点服务器的所有配置在哪里?

I recently used a angular-seed folder from github for angular application development. In some previous angularjs tutorial there was a script folder and a server.js file in the angular-seed folder which had all the configuration for running the node server. So how does npm now just start running a node server and where is all the configuration of that node server?

推荐答案

如果你会查看 package.json 文件.

If you will look at package.json file.

你会看到这样的

 "start": "http-server -a localhost -p 8000"

这告诉在端口 8000

http-server 是一个节点模块.

更新:- 包括@Usman 的评论,理想情况下它应该存在于您的 package.json 中,但如果它不存在,您可以将其包含在 scripts 中 部分.

Update:- Including comment by @Usman, ideally it should be present in your package.json but if it's not present you can include it in scripts section.

这篇关于npm start 如何在端口 8000 上运行服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆