qld-cf / electron-react-tpl

electron12 + umi3.2 + typescript react 16.12 + redux + antDesign 4.0 + eslint tslint react-tslint脚手架, 下载即用,仅供学习参考
155 stars 37 forks source link

[umi] api.addDepInfo is not a function #7

Open nyanboard opened 4 years ago

nyanboard commented 4 years ago

npm run start 出错

[umi] api.addDepInfo is not a function [umi] TypeError: api.addDepInfo is not a function

qld-cf commented 4 years ago

@nyanboard 并没有引用相关plugin 无法复现

  1. 请确认是否是在这个electron-react-tpl项目下npm start
  2. 还有问题的话发一下demo 仓库地址
nyanboard commented 4 years ago

github 地址https://github.com/nyanboard/ddd 我其实就是拉取了你代码,然后npm install >>> npm run start出错了

qld-cf commented 4 years ago

@nyanboard umi自己抽风问题

npm i安装依赖匹配不到对应版本plugin-dva,估计最新版本没发布到生产环境..

先使用yarn安装依赖, ` Couldn't find any versions for "@umijs/plugin-dva" that matches "0.8.1" ? Please choose a version of "@umijs/plugin-dva" from this list: (Use arrow keys) ❯ 0.1.0

` 选择一个0.6.0来完成安装吧

qld-cf commented 4 years ago

umijs/plugin-dva 13分钟前又发了一版

qld-cf commented 4 years ago

https://github.com/umijs/plugins/commit/19fa0c9e9d54a88f13f4c4a16bd0a53b1e677512

nyanboard commented 4 years ago

你的意思是yarn add @umijs/plugin-dva 但是我还是不行啊 0.8.2 和 0.6.0都试过了

qld-cf commented 4 years ago

@nyanboard 删除node_module重新yarn,安装过程中提示选择@umijs/plugin-dva版本,随便选一个就行了

nyanboard commented 4 years ago

为什么我没有提示????

qld-cf commented 4 years ago

@nyanboard 不清楚了...

songxuyao commented 4 years ago

我也遇到一样的问题 `yarn install v1.22.5 warning package.json: No license field info No lockfile found. warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. warning electron-react-app@0.0.1: No license field [1/4] Resolving packages... warning umi > @umijs/core > @hapi/joi@16.1.8: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411) warning umi > @umijs/preset-built-in > @hapi/joi@16.1.8: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411) warning umi > @umijs/core > @hapi/joi > @hapi/formula@1.2.0: This version has been deprecated and is no longer supported or maintained warning umi > @umijs/core > @hapi/joi > @hapi/pinpoint@1.0.2: This version has been deprecated and is no longer supported or maintained warning umi > @umijs/core > @hapi/joi > @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained warning umi > @umijs/core > @hapi/joi > @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained warning umi > @umijs/core > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained warning umi > @umijs/core > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained warning umi > @umijs/preset-built-in > @umijs/bundler-webpack > less > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning umi > @umijs/preset-built-in > @umijs/bundler-webpack > less > request > har-validator@5.1.5: this library is no longer supported warning umi > @umijs/preset-built-in > @umijs/bundler-webpack > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. warning umi > @umijs/preset-built-in > @umijs/bundler-webpack > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. warning umi > @umijs/preset-built-in > fork-ts-checker-webpack-plugin > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated warning umi > @umijs/preset-built-in > fork-ts-checker-webpack-plugin > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning @umijs/fabric > stylelint-config-rational-order > stylelint > postcss-markdown > remark > unified > @types/vfile > @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed. warning @umijs/preset-react > @umijs/plugin-antd > antd-mobile > babel-runtime > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. warning @umijs/preset-react > @umijs/plugin-locale > react-intl > @formatjs/intl-unified-numberformat@3.3.7: We have renamed the package to @formatjs/intl-numberformat warning @umijs/preset-react > @umijs/plugin-locale > react-intl > intl-messageformat-parser > @formatjs/intl-unified-numberformat@3.3.7: We have renamed the package to @formatjs/intl-numberformat warning @umijs/preset-react > @umijs/plugin-locale > react-intl > intl-locales-supported@1.8.12: bad publish warning @umijs/preset-react > @umijs/plugin-test > @umijs/test > jest-environment-jsdom-fourteen > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning @umijs/preset-react > @umijs/plugin-antd > antd-mobile > rmc-list-view > fbjs > core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. warning @umijs/preset-react > @umijs/plugin-test > @umijs/test > jest-environment-jsdom-fourteen > @jest/environment > @jest/transform > jest-haste-map > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. warning @umijs/preset-react > @umijs/plugin-test > @umijs/test > jest-environment-jsdom-fourteen > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 warning @umijs/preset-react > @umijs/plugin-test > @umijs/test > jest-cli > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning @umijs/preset-react > @umijs/plugin-test > @umijs/test > jest-cli > jest-config > jest-environment-jsdom > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 warning wait-on > @hapi/joi@17.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411) warning wait-on > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning wait-on > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 warning wait-on > @hapi/joi > @hapi/formula@2.0.0: This version has been deprecated and is no longer supported or maintained [2/4] Fetching packages... info fsevents@2.1.3: The platform "win32" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "win32" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > @typescript-eslint/eslint-plugin@2.34.0" has unmet peer dependency "eslint@^5.0.0 || ^6.0.0". warning "@typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". warning "@typescript-eslint/eslint-plugin > @typescript-eslint/experimental-utils@2.34.0" has unmet peer dependency "eslint@*". warning " > @typescript-eslint/parser@2.34.0" has unmet peer dependency "eslint@^5.0.0 || ^6.0.0". warning "@umijs/fabric > @typescript-eslint/eslint-plugin@3.10.1" has incorrect peer dependency "@typescript-eslint/parser@^3.0.0". warning " > eslint-plugin-react@7.20.6" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7". warning "@umijs/preset-react > @umijs/plugin-layout@0.12.1" has unmet peer dependency "@ant-design/pro-layout@^5.0.0". warning "@umijs/preset-react > @umijs/plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x". warning "@umijs/preset-react > @umijs/plugin-dva > dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0". warning "@umijs/preset-react > @umijs/plugin-dva > dva-loading@3.0.20" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0". [4/4] Building fresh packages... success Saved lockfile. Done in 182.93s. PS D:\Code\nodejs\electron-react-tpl-master> npm start

electron-react-app@0.0.1 start D:\Code\nodejs\electron-react-tpl-master npm run electron:build && npm run dev

electron-react-app@0.0.1 electron:build D:\Code\nodejs\electron-react-tpl-master cross-env node src/main/script/build

[src/main/script/build.js] Electron webpack 开始构建 [src/main/script/build.js] Electron webpack 构建完成

electron-react-app@0.0.1 dev D:\Code\nodejs\electron-react-tpl-master concurrently -n=umi,electron -c=blue,green -p=[{name}] "cross-env APP_ROOT=src/render umi dev" "wait-on http://localhost:9090 && electron ."

[umi] api.addDepInfo is not a function [umi] TypeError: api.addDepInfo is not a function [umi] at _default (D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\plugin-antd\lib\index.js:84:7) [umi] at Service.initPlugin (D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:405:12) [umi] at Service.initPresetsAndPlugins (D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:313:12) [umi] at D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:227:13 [umi] at Generator.next () [umi] at asyncGeneratorStep (D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:106:103) [umi] at _next (D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:108:194) [umi] at D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:108:364 [umi] at new Promise () [umi] at D:\Code\nodejs\electron-react-tpl-master\node_modules\@umijs\core\lib\Service\Service.js:108:97 [umi] cross-env APP_ROOT=src/render umi dev exited with code 0 `

我是win10

songxuyao commented 4 years ago

@qld-cf @nyanboard 搞定了 把 umi 升级一下 "umi": "^3.2.17" 我用的是这个版本, 其他版本没测试

qld-cf commented 4 years ago

^3.2.17

Thanks♪(・ω・)ノ 我更新下pkg吧,umi有时候是真的坑比