看中了一款很多星星的github的项目,想把这个项目拉到自己的电脑上运行查看项目效果,该怎么做?
示例:我们今天要看的 github项目地址:https://github.com/lzxb/vue-cnode
阅读本篇之前先把这篇文章里面的环境安装好哦。
十分钟上手-搭建vue开发环境(新手教程)
https://www.jianshu.com/p/0c6678671635
1.克隆项目: git clone [https://github.com/lzxb/vue-c...](https://github.com/lzxb/vue-cnode.git)
2.安装nodejs
3.安装依赖: npm install
4.启动服务: npm run dev
1:找到克隆的路径(本步骤不包含下载.zip的方法)
https://github.com/lzxb/vue-cnode.git

图片.png
2:把克隆下来的项目放在D盘
git clone https://github.com/lzxb/vue-cnode.git
以管理员身份打开cmd,进入D盘,执行克隆项目到本地的命令

图片.png
命令行完成之后,D盘多了一个文件夹

图片.png
3:在项目里安装依赖:
npm install
使用命令cd vue-cnode进入克隆下来的项目里,安装依赖,不要直接在D盘里安装,这样会出现错误,安装成功提示:

图片.png
4.启动服务:
npm run dev
启动服务会出现项目浏览的端口号,复制黏贴到浏览器打开即可

图片.png
5:打开浏览器,在浏览器输入http://localhost:3000/,
如下图所示,可以查看GitHub上的这个开源的项目了。

图片.png
原文作者:祈澈姑娘
技术博客:https://www.jianshu.com/u/05f416aefbe190后前端妹子,爱编程,爱运营,爱折腾。
坚持总结工作中遇到的技术问题,坚持记录工作中所所思所见,欢迎大家一起探讨交流。