zgs225 / yapi-plugin-dding

钉钉机器人推送插件 for YAPI
49 stars 17 forks source link

安装失败 #8

Closed snoopy1412 closed 3 years ago

snoopy1412 commented 3 years ago

安装过程有一堆的报错


[error] ./client/containers/Project/Project.js

/my-yapi/vendors/client/containers/Project/Project.js
  44:9  error  componentWillMount is deprecated since React 16.9.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components                       react/no-deprecated
  59:9  error  componentWillReceiveProps is deprecated since React 16.9.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 2 problems (2 errors, 0 warnings)

[error] ./client/containers/User/Profile.js

/my-yapi/vendors/client/containers/User/Profile.js
  88:3  error  componentWillReceiveProps is deprecated since React 16.9.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 1 problem (1 error, 0 warnings)

[error] ./client/containers/Group/ProjectList/ProjectList.js

/my-yapi/vendors/client/containers/Group/ProjectList/ProjectList.js
  85:3  error  componentWillReceiveProps is deprecated since React 16.9.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 1 problem (1 error, 0 warnings)

[error] ./client/containers/Group/GroupList/GroupList.js

/my-yapi/vendors/client/containers/Group/GroupList/GroupList.js
   82:9  error  componentWillMount is deprecated since React 16.9.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components                       react/no-deprecated
  201:3  error  componentWillReceiveProps is deprecated since React 16.9.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

✖ 2 problems (2 errors, 0 warnings)

[error] ./client/containers/Group/GroupSetting/GroupSetting.js

/my-yapi/vendors/client/containers/Group/GroupSetting/GroupSetting.js
  104:3  error  componentWillMount is deprecated since React 16.9.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components                       react/no-deprecated
  196:3  error  componentWillReceiveProps is deprecated since React 16.9.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components  react/no-deprecated

等等等等

然后尝试重启 yapi后报错

Uncaught SyntaxError: Identifier 'Buffer' has already been declared

yapi版本1.9.2 ,linux

zgs225 commented 3 years ago

很抱歉,这个插件目前没有更新,并不适配最新的 yapi。我无法保证什么时候会继续更新这个插件,建议你寻找其他插件。

snoopy1412 commented 3 years ago

很抱歉,这个插件目前没有更新,并不适配最新的 yapi。我无法保证什么时候会继续更新这个插件,建议你寻找其他插件。

好的 o(╥﹏╥)o

zgs225 commented 3 years ago

很抱歉,这个插件目前没有更新,并不适配最新的 yapi。我无法保证什么时候会继续更新这个插件,建议你寻找其他插件。

好的 o(╥﹏╥)o

我这边更新了一下插件,目前支持最新的 yapi 版本了。

上面描述的问题并不是插件本身的问题,而是 yapi 带来的。

React 从 16.9.0 版本开始将 componentWillReceiveProps 生命周期函数废弃了,而 yapi 版本中使用了该生命周期。又因为 yapi中引入 React 版本的方式是 ^16.2.0,这样会将 React 升级到 16.X 的最新版。

所以上述问题有两个解决方案:

  1. yapi 源码更新,使支持最新的 React
  2. vendors 目录中手动安装低版本的 React,比如: yarn add react@16.2.0
liujun0717 commented 3 years ago

手动安装低版本的 React不行啊报同样的错误

xionghaizhi commented 1 year ago

将源码中的package-lock.json覆盖新生成的package-lock.json,就能解决问题了。