三、手动创建live-server前端服务器

                                   手动创建live-server前端服务器


创建web服务器
D:\Vue\VueExample>npm install -g live-server          
C:\Users\yang\AppData\Roaming\npm\live-server -> C:\Users\yang\AppData\Roaming\npm\node_modules\live-server\live-serv
er.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\live-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"
any"} (current: {"os":"win32","arch":"x64"})

+ live-server@1.2.0
added 236 packages from 152 contributors in 31.237s


初始化前端项目(生产package.json文件,记录包的使用)
D:\Vue\VueExample>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (vueexample)
version: (1.0.0)
description: Vue Demo
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to D:\Vue\VueExample\package.json:

{
  "name": "vueexample",
  "version": "1.0.0",
  "description": "Vue Demo",
  "main": "index.js",
  "directories": {
    "example": "example"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this OK? (yes)


启动前端项目
D:\Vue\VueExample>live-server
Serving "D:\Vue\VueExample" at http://127.0.0.1:8080
Ready for changes
GET /favicon.ico 404 4.183 ms - 24
^C终止批处理操作吗(Y/N)? y


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值