【发布时间】:2021-08-21 02:26:44
【问题描述】:
我作为示例使用的 Github 存储库是 following。我正在关注自述文件。之后,我运行以下命令,我遇到了一些问题。
命令是:
yarn install
sfdx plugins:link
yarn build
命令以 yarn build 结束后,我收到以下错误消息:
PS C:\Users\aharo\desktop\Automation\plugin-template> yarn build
yarn run v1.22.5
warning ..\..\..\package.json: No license field
$ sf-build
yarn clean
warning ..\..\..\package.json: No license field
$ sf-clean
,package.json.bak.
yarn compile
warning ..\..\..\package.json: No license field
$ sf-compile
tsc -p . --pretty
../../../node_modules/@types/sizzle/index.d.ts:14:35 - error TS2304: Cannot find name 'Element'.
14 <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
~~~~~~~
../../../node_modules/@types/sizzle/index.d.ts:14:72 - error TS2304: Cannot find name 'Element'.
14 <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
~~~~~~~
../../../node_modules/@types/sizzle/index.d.ts:14:82 - error TS2304: Cannot find name 'Document'.
14 <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
~~~~~~~~
../../../node_modules/@types/sizzle/index.d.ts:14:93 - error TS2304: Cannot find name 'DocumentFragment'.
14 <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
~~~~~~~~~~~~~~~~
../../../node_modules/@types/sizzle/index.d.ts:15:34 - error TS2304: Cannot find name 'Element'.
15 (selector: string, context?: Element | Document | DocumentFragment): Element[];
~~~~~~~
../../../node_modules/@types/sizzle/index.d.ts:15:44 - error TS2304: Cannot find name 'Document'.
Found 17 errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\Users\aharo\desktop\Automation\plugin-template>
【问题讨论】:
-
删除 node_modules 文件夹和 yarn.lock/package.lock 文件并再次运行 yarn install 然后运行 yarn build 或你正在做的任何事情
标签: javascript typescript npm salesforce yarnpkg