搭建THinkJS需要Node.js来下载安装
搭建Node.js参考另一篇文章:Centos搭建Node.js
安装ThinkJS
npm安装ThinkJS
–verbose:显示详细信息
npm install thinkjs@2 -g --verbose
创建验证项目
执行如下命令
thinkjs new project_path;
安装项目依赖
cd project_path
npm install --verbose
启动项目
启动之后为阻塞方式
[root@localhost project_path]# npm start
> thinkjs-application@1.0.0 start /root/project_path
> node www/development.js
[2021-11-01 17:39:13] [Babel] Compile file common/bootstrap/global.js 185ms
[2021-11-01 17:39:13] [Babel] Compile file common/bootstrap/middleware.js 2ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/config.js 9ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/db.js 5ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/env/development.js 2ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/env/production.js 2ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/env/testing.js 2ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/error.js 3ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/hook.js 2ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/locale/en.js 4ms
[2021-11-01 17:39:13] [Babel] Compile file common/config/session.js 6ms
[2021-11-01 17:39:14] [Babel] Compile file common/config/view.js 4ms
[2021-11-01 17:39:14] [Babel] Compile file common/controller/error.js 61ms
[2021-11-01 17:39:14] [Babel] Compile file home/config/config.js 2ms
[2021-11-01 17:39:14] [Babel] Compile file home/controller/base.js 7ms
[2021-11-01 17:39:14] [Babel] Compile file home/controller/index.js 11ms
[2021-11-01 17:39:14] [Babel] Compile file home/logic/index.js 7ms
[2021-11-01 17:39:14] [Babel] Compile file home/model/index.js 10ms
[2021-11-01 17:39:14] [THINK] Server running at http://127.0.0.1:8360/
[2021-11-01 17:39:14] [THINK] ThinkJS Version: 2.3.1
[2021-11-01 17:39:14] [THINK] Cluster Status: closed
[2021-11-01 17:39:14] [THINK] WebSocket Status: closed
[2021-11-01 17:39:14] [THINK] File Auto Compile: true
[2021-11-01 17:39:14] [THINK] File Auto Reload: true
[2021-11-01 17:39:14] [THINK] App Enviroment: development