主要参考该github地址的教程
- 安装nodejs,根据您操作系统的版本下载对应的node
- 安装mongodb。mongodb为nosql数据库,这是下载地址,同样根据自己操作系统的版本选择对应的安装包。建议默认安装到c盘。
- 安装redis,这里提供一个windows下的版本
- 安装 GraphicsMagick Display,它是做图像处理的,nodejs利用gm包调用GraphicsMagick Display来处理图片缩略图,裁剪等动作,直接安装到本地就可以了。
- 运行DoraCMS
- 在github上新建目录DoraCMS
- clone该项目的内容到本地并上传到自己的github仓库
git clone git@github.com:doramart/DoraCMS.git
cd DoraCMS
git remote rm origin
git remote add origin git@github.com:ChenDa1994/DoraCMS.git
git push -u origin master
- 安装cnpm
npm install cnpm -g
- 安装依赖库
cnpm install
报错如下:1234567WARN node unsupported "node@v6.11.0" is incompatible with png-word@0.0.7 › node-png@0.4.2, expected node@0.8.x√ Installed 29 packages√ Linked 206 latest versions√ Run 0 scriptsdeprecate archiver@0.14.4 › glob@4.3.5 › minimatch@^2.0.1 Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue deprecate nodemailer@^1.3.4 All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/√ All packages installed (270 packages installed from npm registry, used 6s, speed 124.56kB/s, json 235(535.42kB), tarball 219.43kB) - 使用
npm start
启动DoraCMS,报错如下:1234567891011121314151617181920212223242526272829303132333435363738394041424344454647> doracms@1.1.1 start F:\Git\DoraCMS> node ./bin/www(node:6544) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-clientevents.js:160throw er; // Unhandled 'error' event^MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]at Pool.<anonymous> (F:\Git\DoraCMS\node_modules\_mongodb-core@2.1.11@mongod b-core\lib\topologies\server.js:328:35)at emitOne (events.js:96:13)at Pool.emit (events.js:188:7)at Connection.<anonymous> (F:\Git\DoraCMS\node_modules\_mongodb-core@2.1.11@mongodb-core\lib\connection\pool.js:280:12)at Connection.g (events.js:292:16)at emitTwo (events.js:106:13)at Connection.emit (events.js:191:7)at Socket.<anonymous> (F:\Git\DoraCMS\node_modules\_mongodb-core@2.1.11@mongodb-core\lib\connection\connection.js:177:49)at Socket.g (events.js:292:16)at emitOne (events.js:96:13)at Socket.emit (events.js:188:7)at emitErrorNT (net.js:1277:8)at _combinedTickCallback (internal/process/next_tick.js:80:11)at process._tickCallback (internal/process/next_tick.js:104:9)npm ERR! Windows_NT 10.0.14393npm ERR! argv "E:\\Program Files\\nodejs\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"npm ERR! node v6.11.0npm ERR! npm v3.10.10npm ERR! code ELIFECYCLEnpm ERR! doracms@1.1.1 start: `node ./bin/www`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the doracms@1.1.1 start script 'node ./bin/www'.npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! If you do, this is most likely a problem with the doracms package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR! node ./bin/wwwnpm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs doracmsnpm ERR! Or if that isn't available, you can get their info via:npm ERR! npm owner ls doracmsnpm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:npm ERR! F:\Git\DoraCMS\npm-debug.log这是因为没有启动mongoDB,需要在mondb的安装目录
C:\Program Files\MongoDB\Server\3.4\bin
放入mongodb.conf
文件,文件是数据存放的地址,我写的是dbpath = E:\Data
,即我的数据库放在E盘的Data目录下,此时再使用以下指令启动mongodb数据库:
mongod --config mongodb.conf
,之后重启node即可。 -
之后照着github地址的教程修改代码插入初始数据即可使用该网页。要注意修改
adminFunc.js
文件的时候最后一句Return true;
是要自己加的,我之前一直忘了加导致访问不了。然后按照教程添加用户和选择模板即可。 - 后台地址为:
127.0.0.1/admin
- 前台地址为:
127.0.0.1