React
二十六画生的博客
国内Top5硕士,先后在京东、字节从事多年后端开发、大数据开发。
展开
-
AntDesignPro环境搭建
如果是windows环境,需要在cmd下执行,不要在idea的terminal下执行!!https://nodejs.org/zh-cn/download/下载的node-v12.13.1-x64.msi已包含npm。1 如果之前安装过低版本的node.js,需要先卸载掉,同时删除C:\Users\你的用户名\AppData\Roaming\npm下的所有子文件和文件夹,如果配了环境变量,...原创 2019-12-09 21:33:58 · 1104 阅读 · 0 评论 -
cnpm install 报错 Install fail! Error: EBUSY: resource busy or locked, symlink 的解决方法
如果是windows环境,需要在cmd下执行,不要在idea的terminal下执行!!需要删除node_modules文件夹,但是提示只有Administrator用户才有权限删除,而且删除很慢,可以使用rimraf删除node_modules文件夹,删除很快。1 安装rimraf :cnpm install rimraf -g2 执行: rimraf node_modules...原创 2019-12-09 21:20:58 · 4162 阅读 · 0 评论 -
cnpm install 报错 SyntaxError: Unexpected end of JSON input (file:的解决方法
需要删除node_modules文件夹,但是提示只有Administrator用户才有权限删除,而且删除很慢,可以使用rimraf删除node_modules文件夹,删除很快。1 安装rimraf :cnpm install rimraf -g2 执行: rimraf node_modules3 清空缓存:npm cache clean --force4 再次安装淘宝镜像:...原创 2019-12-09 21:17:43 · 3411 阅读 · 0 评论 -
fetch请求,No ‘Access-Control-Allow-Origin‘ header的解决方法,SpringBoot支持跨域
Failed to load http://localhost:8080/a/b: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had...原创 2018-10-10 19:12:15 · 18454 阅读 · 0 评论 -
react,修改3000端口
scripts/start.js文件中:现在是修改为了2000,修改成未使用的端口号,重启生效,原创 2018-10-10 18:53:29 · 2253 阅读 · 0 评论 -
npm install 很慢的解决方法
D:\Program\antd\demo4>npm get registry --显示当前的镜像网址https://registry.npmjs.org/D:\Program\antd\demo4>npm config set registry http://registry.npm.taobao.org -- 使用淘宝的镜像网址D:\Program\antd\demo4...原创 2018-10-09 23:07:19 · 21052 阅读 · 4 评论 -
Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary k
antd使用Table报错,报错:Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.解决方法:This one was confusing to me as well, because I was confusing COLUMN ...原创 2018-10-12 19:55:34 · 21157 阅读 · 0 评论 -
React适配Mobx装饰器,Unexpected token (7:2),不支持@
花了两天时间适配,网上太多误人子弟的内容。。。。。。。。。。。。D:\Program\antd>create-react-app demo6D:\Program\antd\demo6>npm install --save mobx mobx-react react-scriptsD:\Program\antd\demo6>npm run eject输入yD:\Prog...原创 2018-09-21 17:34:55 · 1804 阅读 · 0 评论 -
Module not found: Can‘t resolve ‘react‘ in
Module not found: Can't resolve 'react' in 'D:\Program\antd\antd-demo2\node_modules\mobx-react'解决方法:Try removingpackage-lock.json, runnpm installand thennpm startagain.亲测可用...原创 2018-09-21 14:03:06 · 17218 阅读 · 0 评论 -
Response to preflight request doesn‘t pass access control check
安装插件:fetch的请求中就不必带mode:“no-cors”这句话了参考:https://stackoverflow.com/questions/35588699/response-to-preflight-request-doesnt-pass-access-control-check...原创 2018-09-26 21:12:01 · 26099 阅读 · 1 评论 -
react, fetch跨域请求返回的Response.ok==fase,但status是200
fetch中如果是mode:“no-cors”,则可能会出现这个问题,安装插件:fetch的请求中就不必带mode:“no-cors”这句话了参考:https://stackoverflow.com/questions/35588699/response-to-preflight-request-doesnt-pass-access-control-check ...原创 2018-09-26 21:09:21 · 1777 阅读 · 0 评论 -
Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin
安装插件:Allow-Control-Allow-Origin: *fetch的请求中就不必带mode:“no-cors”这句话了 参考:https://stackoverflow.com/questions/35588699/response-to-preflight-request-doesnt-pass-access-control-check ...原创 2018-09-26 21:04:57 · 4052 阅读 · 0 评论 -
React,Error: Cannot find module 'chalk'
Error: Cannot find module 'chalk'at Function.Module._resolveFilename (module.js:547:15)at Function.Module._load (module.js:474:25)at Module.require (module.js:596:17)at require (internal/modul...原创 2018-09-21 11:31:53 · 8208 阅读 · 0 评论 -
React,Error: Cannot find module 'webpack'
Error: Cannot find module 'webpack'at Function.Module._resolveFilename (module.js:547:15)at Function.Module._load (module.js:474:25)at Module.require (module.js:596:17)at require (internal/mod...原创 2018-09-21 11:30:35 · 2240 阅读 · 0 评论 -
create-react-app 使用 antd
以下是在win环境cmd下,可以切换到想安装的目录下再输入命令1 npm install -g create-react-app yarn 安装 create-react-app 和 yarn ;-g表示全局安装,在其他目录下也能使用安装的模块,否则报错;如果不带-g只能在当前目录下使用安装的模块 2 create-react-app antd-demo3 cd antd-d...原创 2018-09-15 08:40:16 · 909 阅读 · 0 评论 -
AntDesign安装和环境配置
1https://nodejs.org/en/下载node.js 并安装一直点击next即可,可参考:Node.js安装及环境配置之Windows篇https://blog.csdn.net/qq_26562641/article/details/722355852 无需配置环境变量,cmd下输入:node --version 输出版本号则表示node.js安装成功,目前node...原创 2018-09-10 21:32:01 · 19265 阅读 · 1 评论 -
安装 dva-cli
win10,前提是正确安装了nodejs和npm,npm安装请看:https://blog.csdn.net/u010002184/article/details/82596389cmd下输入:1 npm install dva-cli -g 应该会运行3分钟左右2 dva -v 查看版本,如果安装成功会输出版本号3 dva new dva-quickstart 应该会运行...原创 2018-09-16 09:12:08 · 6301 阅读 · 0 评论