接私活利器【人人开源】renren-fast-vue的使用

194 阅读1分钟

首先在gitee上下载项目,运行的时候还是遇到了很多问题的。首先下载node

官方给的教程上面,就两个步骤:

  1. npm install
  2. npm run dev

但是实际运行的时候报错很多,基本上运行不起来。我先来说我最终的解决方案:

环境:MacBook Pro

首先切换到root,苹果环境su root还真不行,参考www.jianshu.com/p/2c2da7fb3…

sudo su

安装node版本管理模块n参考:www.fengnayun.com/news/conten…

sudo npm install n -g

//安装node版本(别的版本不太行)

n 14.17.0

最重要的一步来了,因为项目npm install的时候有个chromedriver2.27一直下载不下来,问题很大,网上搜解决办法都是用npm install chromedriver@2.27.2 --ignore-scripts忽略掉这个依赖,但是后面有别的问题再执行一些操作的时候总是又会报错,所以我直接在项目的package.json文件中把这个依赖删掉了。再运行就好用了。 解决问题期间用到的命令:

npm cache clean --force 清除一下缓存
npm config set registry https://registry.npm.taobao.org/ 设置淘宝镜像
(最新的好像是https://registry.npmmirror.com/)
npm config get registry查看镜像源
安装cnpm
npm install -g cnpm -registry=https://registry.npm.taobao.org
升级npm指令:`npm install -g npm`(没用过)