node -v => v11.1.0
1.执行:安装cli npm i dva-cli -g 报错
2.报错:Unexpected end of JSON input while parsing near ‘…perties",“version”:"7’
3.执行:npm cache clean -force
4.命令:npm i dva-cli -g 成功
5.创建新项目 dva new [project name] => dva new demo
-
.webpackrc文件中加:
“entry”:"./src/index.js",
“extraBabelPlugins”:[
[“import”,{“libraryName”:“antd”,“style”:“css”}]
],
“proxy”:{
“/api”:{
“target”:“http://localhost:9000/”,
“changeOrigin”:true,
“pathRewrite”:{
“^/api”:""
}
}
}
7.npm install
8.npm run s