Consulting description:ohpm dayjs编译不通过,是使用以下命令安装的
ohpm install dayjs --save-dev --save-prod
Scenario:大写也报错:import { Dayjs } from ‘dayjs’
05-29 21:00:41.226 65078-65078 E [nodict]Error message:the requested module '@package:pkg_modules/.ohpm/dayjs@1.11.7/pkg_modules/dayjs/dayjs.min' does not provide an export named 'Dayjs' which imported by 'weightloss.fasting.tracker.cn/entry/ets/common/TimeHelper'
小写也报错:import { dayjs } from ‘dayjs’
'"dayjs"' has no exported member named 'dayjs'. Did you mean 'Dayjs'? <ArkTSCheck
Raised by:
Expected reply time:
删除同级目录下的oh\_modules和oh-packages-lock.json文件,使用命令ohpm install dayjs下载依赖,导入的时候不用加大括号import dayjs from 'dayjs';