strapi安装和开始

笔者部署在vagrant上的,有需要的同学可以了解一下,个人还是很喜欢vagrant的,每次要测(chang)试(xian)新的开源项目都会用全新的纯净的系统部署开发环境会更有利于排除错误和增长使用熟练度,多多益善,毕竟,没了Google我什么都不会。

安装strapi前的准备工作

安装strapi的环境依赖

  • Node.js >= 10.x: Node.js is a server platform which runs JavaScript. Installation guide here.
  • NPM >= 6.x: NPM is the package manager for Javascript. Installation guide here. (Make sure the database that you are using meets the requirement.)
  • Strapi支持一下数据库,选一即可:
    • MongoDB >= 3.x: MongoDB is a powerful document store. Installation guide here.
    • MySQL >= 5.6: MySQL is an open-source relational database management system. Installation guide here.
    • MariaDB >= 10.1: MarialDB is a fork of MySQL and is guaranteed to stay open source. Installation guide here.
    • PostgreSQL >= 10: PostgreSQL is an open-source object-relational database management system. Installation guide here

开始安装Strapi

npm install [email protected] -g

安装完成后检查版本

strapi -v

输出

3.0.0-alpha.14.5

创建第一个应用

strapi new project-name

注意,笔者在这里遇到了在vagrant中映射目录创建失败的问题,详细链接:

Generate a Strapi project

运行应用

cd my-project
strapi start

Start Strapi

这时候你访问 http;//localhost:1337/ 就可以访问你的应用地址了.

Post Comment