- Download package fron 'https://nodejs.org/en/'
- install nodejs (Please use version 8.6)
- 安装npm:
sudo npm install npm@5.3.0 -g
- 安装serve:
npm install -g serve
- Intsall electron binary (1.7.9):
npm install electron@1.7.9 -g
After that You will get node version to be 8.6.xxx. To check it with commands:
electron --version
node --version
npm --version
- cd elreact
- npm i
- 以下三种运行方式任选一种即可
四种运行模式(主要选择1,3, 4)
使用以下命令运行,结果显示在浏览器中 (端口号是 3008):
npm run start
然后打开浏览器,输入:http://localhost:3008/
npm run build
serve -s build
然后打开浏览器,输入:http://localhost:5000/
npm run electron-dev
npm run build
npm run electron
这部分留作备注使用,一些链接以及一些程序设计时的注意事项。
React: https://github.com/facebook/react/releases
redux: https://redux.js.org/docs
jquery: http://jquery.com/
socketio: https://socket.io/
ant-design:https://ant.design/docs/spec
Redux:
Things you should never do inside a reducer:
- Mutate its arguments;
- Perform side effects like API calls and routing transitions;
- Call non-pure functions, e.g. Date.now() or Math.random().