1. 程式人生 > >三、手動建立live-server前端伺服器

三、手動建立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: [email protected]
(node_modules\live-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":" any"} (current: {"os":"win32","arch":"x64"}) + [email protected] 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