我想从画廊上传照片,但使用@capacitor/core,它只会打开相机。而且,安装@capacitor/相机后显示此错误。
[ng] ERROR in node_modules/@capacitor/camera/dist/esm/definitions.d.ts:1:13 - error TS1005: '=' expected.
[ng] 1 import type { PermissionState } from '@capacitor/core';
[ng] ~
[ng] node_modules/@capacitor/camera/dist/esm/definitions.d.ts:1:38 - error TS1005: ';' expected.
[ng] 1 import type { PermissionState } from '@capacitor/core';
[ng] ~~~~~~~~~~~~~~~~~
[ng] node_modules/@capacitor/camera/dist/esm/index.d.ts:1:13 - error TS1005: '=' expected.
[ng] 1 import type { CameraPlugin } from './definitions';
[ng] ~
[ng] node_modules/@capacitor/camera/dist/esm/index.d.ts:1:35 - error TS1005: ';' expected.
[ng] 1 import type { CameraPlugin } from './definitions';
[ng] ~~~~~~~~~~~~~~~
这是我的package.json
文件。
"@capacitor/android": "^2.0.1",
"@capacitor/camera": "^1.3.1",
"@capacitor/core": "2.0.1",
"@capacitor/ios": "^2.0.1",
1条答案
按热度按时间vc9ivgsu1#
这是一个typescript错误,所以首先将typescript升级到最新版本。
然后检查版本
复制版本并在package.json中搜索typescript并粘贴版本.现在执行