在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,清理了缓存 都还是没用
求助
查看全部
qq_42796438
小贝在这里
2020/07/08 23:57
  • react.js
  • node.js
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复