纯粹问题流水,勿喷!^_^
1.问题:
升级node v8.2.1,npm 5.3.0后antd-adimin下npm install报错
antd-admin git:(master) ✗ npm installnpm WARN checkPermissions Missing write access to /home/quanpower/antd-admin/node_modules/_read-pkg-up@2.0.0@read-pkg-up/node_modules/find-upnpm ERR! path /home/quanpower/antd-admin/node_modules/_read-pkg-up@2.0.0@read-pkg-up/node_modules/find-upnpm ERR! code ENOENTnpm ERR! errno -2npm ERR! syscall accessnpm ERR! enoent ENOENT: no such file or directory, access '/home/quanpower/antd-admin/node_modules/_read-pkg-up@2.0.0@read-pkg-up/node_modules/find-up'npm ERR! enoent This is related to npm not being able to find a file.npm ERR! enoent npm ERR! A complete log of this run can be found in:npm ERR! /home/quanpower/.npm/_logs/2017-08-07T09_34_38_562Z-debug.log
Google试了若干办法都没搞定,也看到好多人说npm 5会出这问题,有npm cache verify,npm cache clean -f,有说打开着IDE问题,也去github npm issue里看了下https://github.com/npm/npm/issues/17444,没找到根本答案,浪费了一天时间,最后还是rm -rf node-modules重新来过了。
➜ antd-admin git:(master) ✗ npm installnpm ERR! code EINTEGRITYnpm ERR! sha512-mZJTSg2RcBEXHJnUYNZIttcXNAjupunR57qXfyGoHSsJ0pLKOVsfu8HsBVxizkcNVxuJYlfLLIGJ7rparFNsUA== integrity checksum failed when using sha512: wanted sha512-mZJTSg2RcBEXHJnUYNZIttcXNAjupunR57qXfyGoHSsJ0pLKOVsfu8HsBVxizkcNVxuJYlfLLIGJ7rparFNsUA== but got sha512-1MH6PA4ziRpVADMguYmQfaZHbOSZIvYiL5JvEsRD7Z7UmIgZIJD+2qI6ZBqD2bx4EZDLrocAOT9GclpOUU5ekA==. (5771020 bytes)npm ERR! A complete log of this run can be found in:npm ERR! /home/quanpower/.npm/_logs/2017-08-07T10_55_25_429Z-debug.log
结果出现checksum问题,后面又把package-lock.json干掉!终于可以继续调试了,问题症结不解。
2.dva
过了一遍大dva+antd crud的例子
https://github.com/sorrycc/blog/issues/18
3.推荐一个调试工具:Redux Devtools + react developertools配合使用,数据流十分清晰
4.利用git submodule将项目加到另外一个smart-iiot里面,另superset也考虑加
参考https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E5%AD%90%E6%A8%A1%E5%9D%97
http://www.kafeitu.me/git/2012/03/27/git-submodule.html