git clone 到本地,跑不起来,是有什么注意的问题吗
Closed this issue · 11 comments
最好把错误信息贴出来。
我npm install 的时候,返回了一个404 错误,然后使用cnpm ,安装是成功的,但是npm start 的时候,报了一堆错误。
`> antd-react-form-builder@0.5.0 start /Users/wangyongrui01/javascript/antd-react-form-builder
cross-env NODE_ENV=development node server.js
==> 🌎 Listening on port 6688. Open up http://localhost:6688/ in your browser.
webpack built 2b86cde77da7617d3f1c in 14261ms
---------- { Error: no such file or directory
at MemoryFileSystem.readFileSync (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_memory-fs@0.4.1@memory-fs/lib/MemoryFileSystem.js:107:10)
at Compiler. (/Users/wangyongrui01/javascript/antd-react-form-builder/server.js:27:20)
at Compiler.applyPlugins (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_tapable@0.2.8@tapable/lib/Tapable.js:61:14)
at Watching._done (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compiler.js:98:16)
at onCompiled (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compiler.js:49:17)
at /Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compiler.js:499:13
at next (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_tapable@0.2.8@tapable/lib/Tapable.js:202:11)
at Compiler. (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/CachePlugin.js:62:5)
at Compiler.applyPluginsAsyncSeries (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_tapable@0.2.8@tapable/lib/Tapable.js:206:13)
at /Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compiler.js:496:10
at Compilation.applyPluginsAsyncSeries (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_tapable@0.2.8@tapable/lib/Tapable.js:195:46)
at self.applyPluginsAsync.err (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compilation.js:649:19)
at Compilation.applyPluginsAsyncSeries (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_tapable@0.2.8@tapable/lib/Tapable.js:195:46)
at self.applyPluginsAsync.err (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compilation.js:640:11)
at Compilation.applyPluginsAsyncSeries (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_tapable@0.2.8@tapable/lib/Tapable.js:195:46)
at self.applyPluginsAsync.err (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_webpack@2.7.0@webpack/lib/Compilation.js:635:10)
code: 'ENOENT',
errno: 34,
message: 'no such file or directory',
path: '/Users/wangyongrui01/javascript/antd-react-form-builder/public/js//index.html' }
Hash: 2b86cde77da7617d3f1c
Version: webpack 2.7.0
Time: 14261ms
Asset Size Chunks Chunk Names
bundle.js?hash=2b86cde77da7617d3f1c 11.6 MB 0 app
chunk {0} bundle.js?hash=2b86cde77da7617d3f1c (app) 4.07 MB [entry] [rendered]
[0] .//_react@15.6.2@react/react.js 56 bytes {0} [built]/_react-dom@15.6.2@react-dom/index.js 59 bytes {0} [built]
[13] ./
[88] (webpack)/buildin/module.js 517 bytes {0} [built]
[127] ./demo/config.js 547 bytes {0} [built]
[128] ./demo/container.jsx 3.73 kB {0} [built]
[443] ./demo/index.jsx 612 bytes {0} [built]
[444] .//_react-hot-loader@3.1.3@react-hot-loader/patch.js 40 bytes {0} [built]/_webpack-hot-middleware@2.21.2@webpack-hot-middleware/client.js 7.35 kB {0} [built]
[445] ./
[527] ./demo/Locale.jsx 7.37 kB {0} [built]
[928] .//_react-hot-loader@3.1.3@react-hot-loader/lib/patch.dev.js 6.38 kB {0} [built]/_react-hot-loader@3.1.3@react-hot-loader/lib/patch.js 209 bytes {0} [built]
[929] ./
[950] .//_strip-ansi@3.0.1@strip-ansi/index.js 161 bytes {0} [built]/_webpack-hot-middleware@2.21.2@webpack-hot-middleware/client-overlay.js 2.21 kB {0} [built]
[962] ./
[963] ./~/_webpack-hot-middleware@2.21.2@webpack-hot-middleware/process-update.js 4.33 kB {0} [built]
[964] multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx 52 bytes {0} [built]
+ 950 hidden modules
ERROR in ./demo/container.jsx
Module not found: Error: Can't resolve '../lib/index' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/container.jsx 13:0-102
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/container.jsx
Module not found: Error: Can't resolve '../lib/style' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/container.jsx 21:0-22
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/UseWithConfig.jsx
Module not found: Error: Can't resolve '../lib/index' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/UseWithConfig.jsx 19:0-83
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/JSXStyle.jsx
Module not found: Error: Can't resolve '../lib/index' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/JSXStyle.jsx 14:0-176
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/Locale.jsx
Module not found: Error: Can't resolve '../lib/index' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/Locale.jsx 22:0-83
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/UseWithConfig.jsx
Module not found: Error: Can't resolve '../lib/util' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/UseWithConfig.jsx 27:0-31
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/JSXStyle.jsx
Module not found: Error: Can't resolve '../lib/util' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/JSXStyle.jsx 12:0-31
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in ./demo/Locale.jsx
Module not found: Error: Can't resolve '../lib/locale-provider/es_US' in '/Users/wangyongrui01/javascript/antd-react-form-builder/demo'
@ ./demo/Locale.jsx 32:0-59
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
ERROR in .//_css-loader@0.23.1@css-loader!.//_sass-loader@4.1.1@sass-loader!./style/css/demo.scss
Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (57)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v3.13.1
at module.exports (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_node-sass@3.13.1@node-sass/lib/binding.js:13:13)
at Object. (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_node-sass@3.13.1@node-sass/lib/index.js:14:35)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (/Users/wangyongrui01/javascript/antd-react-form-builder/node_modules/_sass-loader@4.1.1@sass-loader/index.js:4:12)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
@ ./style/css/demo.scss 4:14-155 13:2-17:4 14:20-161
@ ./demo/Locale.jsx
@ ./demo/container.jsx
@ ./demo/index.jsx
@ multi react-hot-loader/patch webpack-hot-middleware/client ./demo/index.jsx
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 1.48 MB 0
chunk {0} index.html 543 kB [entry] [rendered]
[0] .//_lodash@4.17.5@lodash/lodash.js 540 kB {0} [built]/_html-webpack-plugin@2.30.1@html-webpack-plugin/lib/loader.js!./html_template/index.html 2.34 kB {0} [built]
[1] ./
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
[3] (webpack)/buildin/module.js 517 bytes {0} [built]`
其中我看到一个这个错误 ERROR in .//_css-loader@0.23.1@css-loader!.//_sass-loader@4.1.1@sass-loader!./style/css/demo.scss
Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (57) 有什么解决办法吗,多谢
你有改过配置不
/Users/wangyongrui01/javascript/antd-react-form-builder/public/js//index.html
应该是下面的路径才正常
/Users/wangyongrui01/javascript/antd-react-form-builder/public/index.html
你好,配置在哪写里修改呀,我没有修改过配置呀
代码里本来也没有antd-react-form-builder/public 这个文件夹呀
我忘了,这个webpack服务是旧的,上面说的不对
需要这样运行
npm install
npm run build-default-watch#生成libs的文件
npm start
可以看下package.json的文件
"scripts": {
"start": "cross-env NODE_ENV=development node server.js",
"build-demo": "cross-env NODE_ENV=production grunt",
"build": "npm run build-es && npm run build-default && node-sass style/css/style.scss lib/style/style.css",
"build-es": "cross-env BABEL_ENV=es babel ./src -d es --ignore spec.js,test.js",
"build-default": "cross-env BABEL_ENV=default babel ./src -d lib --ignore spec.js,test.js",
"build-default-watch": "cross-env BABEL_ENV=default babel ./src -d lib -w --ignore spec.js,test.js",
"build-es-watch": "cross-env BABEL_ENV=es babel ./src -d es -w",
"updateSnapshot": "cross-env NODE_ENV=default jest --updateSnapshot",
"test": "cross-env NODE_ENV=default jest --coverage"
},
这个项目以后或许要重构
重构+1
要抽时间处理,应该是最近
重构思路是如何,我可以帮把手
还是按照这几点
- 解决Antd的表单验证会触发整个组件渲染的问题
- 组件自带验证,不需要使用getFieldDecorator
同时会把嵌套表单这个功能去掉,这个实在不好使,应用场景少,现在公司也用不到这个了。
之前使用到了form-serialize
这个类库来提取表单值,现在改为通过react受控表单获取表单值。
form.create()尽量跟antd一致,用法还是跟这个项目差不多。