本地搭建 yapi 出现了 Cannot find module 'node-sass' 问题


node环境     自行百度

mongdb 数据库 自行百度

mkdir yapi cd yapi git clone https://github.com/YMFE/yapi.git vendors --depth=1 //或者下载 zip 包解压到 vendors 目录 cp vendors/config_example.json ./config.json //复制完成后请修改相关配置 cd vendors

编辑 config.json 修改数据库信息
npm install --production --registry https://registry.npm.taobao.org //安装依赖 npm run install-server //安装程序会初始化数据库索引和管理员账号,管理员账号名可在 config.json 配置
npm run dev 

安装yapi 执行 本地运行开发环境 npm run dev 时出现 Cannot find module 'node-sass' 意识到 node 环境没有安装 node-sass
一番百度后

  • 接下来我安装了淘宝的npm镜像然后再安装node-sass,解决以上问题。
 

1. npm install -g cnpm --registry=https://registry.npm.taobao.org (安装淘宝镜像)
2. cnpm install node-sass --save (使用淘宝镜像安装node-sass)

 

 

 

成功啦 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM