小贝在这里 2020-07-08 23:57 采纳率: 50%
浏览 1527
已采纳

在taro init myApp 时,报UnhandledPromiseRejectionWarning: Error: Cannot find module 'lodash/fp'错误,怎么解决?

UnhandledPromiseRejectionWarning: Error: Cannot find module 'lodash/fp'
Require stack:

  • /usr/local/lib/node_modules/@tarojs/cli/dist/doctor/configValidator.js
  • /usr/local/lib/node_modules/@tarojs/cli/dist/presets/commands/build.js
  • /usr/local/lib/node_modules/@tarojs/cli/node_modules/_@tarojs_service@3.0.2@@tarojs/service/dist/utils/index.js
  • /usr/local/lib/node_modules/@tarojs/cli/node_modules/_@tarojs_service@3.0.2@@tarojs/service/dist/Kernel.js
  • /usr/local/lib/node_modules/@tarojs/cli/node_modules/_@tarojs_service@3.0.2@@tarojs/service/dist/index.js
  • /usr/local/lib/node_modules/@tarojs/cli/node_modules/_@tarojs_service@3.0.2@@tarojs/service/index.js
  • /usr/local/lib/node_modules/@tarojs/cli/dist/cli.js
  • /usr/local/lib/node_modules/@tarojs/cli/bin/taro at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15) at Function.Module._load (internal/modules/cjs/loader.js:842:27) at Module.require (internal/modules/cjs/loader.js:1026:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (/usr/local/lib/node_modules/@tarojs/cli/src/doctor/configValidator.ts:1:1) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Module._compile (/usr/local/lib/node_modules/@tarojs/cli/node_modules/_pirates@4.0.1@pirates/lib/index.js:99:24) at Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Object.newLoader as .js at Module.load (internal/modules/cjs/loader.js:986:32) (node:49727) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:49727) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ```
该怎么解决呀?
尝试了重新装nodejs,全局安装了lodash,清理了缓存 都还是没用
求助
  • 写回答

1条回答 默认 最新

  • 小白蛤蛤 2020-07-09 00:41
    关注

    lodash升级导致的,yarn add lodash@4.17.15 就好了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决