前端搭建本地服务器(Node)

 

通过Node

  去官网下载Node并安装。直通车:http://nodejs.cn/

 

安装成功

  打开cmd(命令提示符),输入‘node-v’检查是否安装成功。下图是安装成功,显示的版本可能会不一样(没问题)。

    

 

上步完成后 打开cmd安装anywhere或http-server

  anywhere 安装指令 :npm install anywhere -g

  http-server 安装指令 :npm install http-server-g

 

anywhere

  打开cmd输入 anywhere

  

 

http-server

  打开cmd输入 http-server

  

 

npm安装不上问题(网络)

  使用淘宝镜像

    打开cmd 输入

      npm i -g cnpm --registry=https://registry.npm.taobao.org

    安装成功后

 

npm改成cnpm

  anywhere 安装指令 :cnpm install anywhere -g   

  http-server 安装指令 :cnpm install http-server-g

  

 

 

posted @ 2020-05-20 09:46  小泽沐优声  阅读(390)  评论(0编辑  收藏  举报