安装脚手架工具
brew install lean-cli
在mac的安装过程中可能会出现以下提示:
Error: The following directories are not writable by your user:
/usr/local/share/man/man5
/usr/local/share/man/man7
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
意思是没有权限,按照提示运行下面的命令即可
sudo chown -R $(whoami) /usr/local/share/man/man5
登录leanclound
在控制台创建项目
登录leanclound,进入控制台,创建应用
初始化项目
执行lean init
, 选择初始化哪一个项目,并选择nodejs框架
image.png
执行npm i
安装依赖
执行lean up
启动项目
用浏览器打开 http://localhost:3000/, 出现以下页面即为成功
image.png