【发布时间】:2020-11-04 11:31:20
【问题描述】:
按照official documentation 中的建议,我正在使用 Yeoman 生成器为 TinyMCE 创建一个新插件。
但是,即使我使用yo tinymce 和npm install 创建了一个完全空的项目,也可以观看该项目(npm start),但是当我尝试构建它时(npm run build)它在以下错误列表(高度缩短):
Running "clean:dirs" (clean) task
>> 0 paths cleaned.
Running "tslint:plugin" (tslint) task
>> 6 files lint free.
Running "shell:command" (shell) task
node_modules/@ephox/agar/lib/main/ts/ephox/agar/api/DragnDrop.d.ts(11,34): error TS2304: Cannot find name 'File'.
node_modules/@ephox/agar/lib/main/ts/ephox/agar/api/DragnDrop.d.ts(15,38): error TS2304: Cannot find name 'File'.
// A lot other node_modules error lines here
node_modules/tinymce/tinymce.d.ts(2745,29): error TS2304: Cannot find name 'Document'.
node_modules/tinymce/tinymce.d.ts(2751,45): error TS2304: Cannot find name 'Window'.
node_modules/tinymce/tinymce.d.ts(2752,54): error TS2304: Cannot find name 'Document'.
node_modules/tinymce/tinymce.d.ts(2752,65): error TS2304: Cannot find name 'ShadowRoot'.
Warning: Command failed: tsc
Use --force to continue.
Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! myproject@1.0.0 build: `grunt`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the myproject@1.0.0 build script.
您对如何克服这个问题有任何想法吗?我尝试在 Windows 和 WSL 上构建代码。
感谢您的帮助。
【问题讨论】:
标签: typescript npm tinymce yeoman tinymce-plugins