安装web框架
pip install git+https://gitee.com/charlock/web.git
安装认证,签名,数据库
pip install bcrypt
pip install PYJWT
pip install sqlalchemy
pip install webob
pip install pymysql
安装nodejs
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install -y gcc-c++ make
sudo yum -y install nodejs
安装babel
sudo mkdir demo
cd demo
sudo npm init
sudo npm install --save-dev babel-cli
sudo vim package.json
{
"name": "my-project",
"version": "1.0.0",
+ "scripts": {
+ "build": "babel src -d lib"
+ },
"devDependencies": {
"babel-cli": "^6.0.0"
}
}
sudo mkdir src
sudo mkdir lib
sudo npm run build
# ./node_modules/.bin/babel src -d lib
sudo npm install babel-preset-env --save-dev
sudo vim .babelrc
{
"presets": ["env"]
}
sudo npm --version
5.3.0
安装react-router,marked
npm i react-router --save
npm i marked --save
安装react
sudo git clone https://git.coding.net/comyn/react-mobx-starter.git
cd react-mobx-starter
npm cache clean --force
npm i
npm start
错误
npm ERR! Unexpected end of JSON input while parsing near '....npm.taobao.org/webpa'
可能1:
npm cache clean --force
npm i
可能2:
检查网络,网络不顺畅会出错
设置npm源
如果npm i下载缓慢 卡住的话,设置npm源
npm.taobao.sh
npm set registry https://registry.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set chromedriver_cdnurl http://cdn.npm.taobao.org/dist/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl http://cdn.npm.taobao.org/dist/operadriver # operadriver 二进制包镜像
npm set phantomjs_cdnurl http://cdn.npm.taobao.org/dist/phantomjs # phantomjs 二进制包镜像
npm set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass # node-sass 二进制包镜像
npm set electron_mirror http://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
npm set selenium_cdnurl=http://npm.taobao.org/mirrors/selenium
npm set node_inspector_cdnurl=https://npm.taobao.org/mirrors/node-inspector
npm cache clean --force # 清空缓存