我有编译为UMD的库( Tus.io ) 。我在我的 Angular2/4 项目中需要它。当我使用 npm 安装它(npm install tus-js-client)并导入它(var tus = require("tus-js-client");)时,我得到的错误是:
Failed to compile.
/home/***/src/app/manageVideos/Partials/add.component.ts (8,17):
Module '../../../../node_modules/tus-js-client/dist/tus.js'
was resolved to '/home/***/node_modules/tus-js-client/dist/tus.js',
but '--allowJs' is not set.
/home/***/src/app/manageVideos/Partials/add.component.ts (9,11): Cannot find name 'require'.