SyntaxError:无法在Angular/Nx/jest应用程序中使用@ionic native/health的模块外使用导入语句

SyntaxError:无法在Angular/Nx/jest应用程序中使用@ionic native/health的模块外使用导入语句,angular,jestjs,ionic-native,nrwl-nx,Angular,Jestjs,Ionic Native,Nrwl Nx,请帮忙,我明白了 SyntaxError: Cannot use import statement outside a module" 在Angular应用程序中使用@ionic native/health。在此处进行回购,运行“npm i”,然后运行“ng测试”: 我相信我终于找到了答案: jest.config.js transformIgnorePatterns: ['node_modules/(?!@ngrx|@ionic-native|@ionic)'] tsconfig.sp

请帮忙,我明白了

SyntaxError: Cannot use import statement outside a module" 
在Angular应用程序中使用@ionic native/health。在此处进行回购,运行“npm i”,然后运行“ng测试”:


我相信我终于找到了答案:

jest.config.js

transformIgnorePatterns: ['node_modules/(?!@ngrx|@ionic-native|@ionic)']
tsconfig.spec.json

"allowJs": true

请更新您的帖子:复制/粘贴(文本)您引用“@ionic native/health”的位置。我在app.component.spec.ts中没有看到它-看起来不错。问题是“ng测试”不知何故会阻塞index.js,这会导致非法语法错误。