weex-plugins / Chart-for-Apache-Weex

Chart for Apache Weex is a third party plugin, and is not developed nor maintained by Apache Weex.
Apache License 2.0
35 stars 12 forks source link

weex-chart插件安装之后node_modules消失原因,望修正 #13

Open ellisez opened 6 years ago

ellisez commented 6 years ago

weex-chart插件安装之后node_modules消失原因:

经反复测试发现: weexpack plugin add weex-chart 刚执行完成,node_modules中本来是有weex-chart目录的。

但是很遗憾,当作任何npm操作,如: weexpack run android npm install 等等。。。。

node_modules下的weex-chart目录将立刻被删除

经查日志发现,原因如下: weex-chart目录下package.json中name为 "name": "weex-plugin-weex-chart" weex-plugin-weex-chart与目录名weex-chart不一致 根据NPM标准,两者不一致为无效包,所以NPM自己清理掉weex-chart

之后所有的连锁反应都来自此,望早日修复,谢谢

目前我的解决方法是,手动从plugins中拷贝到node_modules,然后package.json的name改为weex-chart, 可用

ellisez commented 6 years ago

另外模板项目weexteam/weexpack-android,目前有严重bug告知一下,看是否weex-chart自身能调整

weexpack-android 提交号为67c260e4ac2d850eea0736a4c965a7fe4dc3a2ce,提交描述为update weex sdk version.

模板中缺失了,weexplugin目录

也就是weexteam/weexplugin-android的源码引用

由此weexpack create出来的项目均不可以plugin add插件

目前我是手动拷贝的,尚可用

如果weex-chart自己可以引用weexplugin目录,那就更好了

只是建议

ellisez commented 6 years ago

非常遗憾,经测试: 即使package.json的name与目录名相同为weex-chart, 经过一次npm install之后仍然会被删除掉 新版的nodejs v8.9似乎必须注册在项目的package.json才能保证不会被删除

所以我给出的建议是: weexpack plugin add weex-chart执行时追加一条命令npm install plugin/weex-chart, 本地路径安装插件方式,同时此plugin/weex-chart/package.json中的name也要改成weex-chart,而不是原来的weex-plugin-weex-chart

同样的weexpack plugin remove weex-chart删除插件,也要追加一条命令npm uninstall plugin/weex-chart

目前手动改的,经测试可用

ellisez commented 6 years ago

唯一不足是,我想,对于插件而言,name为weex-chart,和name为weex-plugin-weex-chart,是一个不可逆推的过程。也许插件对应会混乱