分享一个小小的 Vue.js + Node.js 的 后台管理系统
发布于 8 年前 作者 jkjk77 19091 次浏览 来自 分享

源码: https://github.com/ericjjj/vms

VMS

Vue Management System

Code Climate Test Coverage license

环境

  • nodejs 6+
  • mongodb 3+

特性

  • Vue 2+
  • Element UI
  • 集成 wangEditor 富文本编辑器 (新浪表情包支持)
  • 集成七牛云图片上传
  • 集成极光推送
  • 完整 Node.js 后端
  • 后端角色权限控制
  • 容易部署

如何运行

git clone https://github.com/ericjjj/vms.git

// 启动后端, 依赖 mongodb
cd backend/utils
// 复制配置文件, 并修改对应配置
cp config.simple.js config.js
cd ..
// 运行
node index.js


// 启动前端
cd backend/utils
// 复制配置文件, 并修改对应配置
cp config.simple.js config.js
cd ..
// 运行
npm run dev

测试

cd backend
npm run test

互相交流 谢谢啦

12 回复

npm run dev ERROR in ./src/stores/api.js Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/config in vms\frontend
src\stores @ ./src/stores/api.js 8:14-34

ERROR in ./src/tools/index.js Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/config.js in vms\fronte nd\src\tools @ ./src/tools/index.js 15:14-37

cp config.simple.js config.js

@yakczh cp config.simple.js config.js

mark

来自酷炫的 CNodeMD

@jkjk77 1,412 config.js 1,412 config.simple.js backend 是正常的 是在npm run dev的时候报错 好象是webpack的问题 完整的错误信息  ------------------ npm run dev VMS@1.0.0 dev  vms\frontend node build/dev-server.js

Listening at http://127.0.0.1:8080

webpack: wait until bundle finished: /index.html webpack built 913fa36a361ef1997f48 in 53071ms Hash: 913fa36a361ef1997f48 Version: webpack 1.14.0 Time: 53071ms Asset Size Chunks Chunk Names static/fonts/icomoon.0a74426.eot 15.6 kB static/fonts/icomoon.9f5fd7b.ttf 15.5 kB static/fonts/icomoon.7d4ac7d.woff 15.6 kB static/img/icomoon.f558046.svg 47.3 kB app.js 9.25 MB 0 app

WARNING in ./~/vue-loader/lib/template-compiler?{“id”:“data-v-2f9cc3c4”}!./~/vue-loader/lib/templat -compiler/preprocessor.js?raw&engine=pug!./~/vue-loader/lib/selector.js?type=template&index=0!./src views/items/Users.vue <el-option v-for=“item in options”>: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.

WARNING in ./~/vue-loader/lib/template-compiler?{“id”:“data-v-2f9cc3c4”}!./~/vue-loader/lib/templat -compiler/preprocessor.js?raw&engine=pug!./~/vue-loader/lib/selector.js?type=template&index=0!./src views/items/Users.vue <el-option v-for=“item in options”>: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.

ERROR in ./src/stores/api.js Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/config in  \vms\frontend src\stores @ ./src/stores/api.js 8:14-34

ERROR in ./src/tools/index.js Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/config.js in  \vms\front nd\src\tools @ ./src/tools/index.js 15:14-37 Child html-webpack-plugin for “index.html”: Asset Size Chunks Chunk Names index.html 1.47 MB 0 webpack: Failed to compile.

@yakczh cp config.simple.js config.js

MacBook-Pro:backend jiahongxiang$ NODE_ENV=dev node index.js module.js:471 throw err; ^

Error: Cannot find module 'babel-core/register’ at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/jiahongxiang/Downloads/demo/vms-master/backend/index.js:6:1) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

楼主我这个错是什么原因?
回到顶部