gpt4 book ai didi

typescript - 在 MacOs 上运行 Ionic 项目后出现大量 TypeScript 错误

转载 作者:搜寻专家 更新时间:2023-10-30 21:34:20 26 4
gpt4 key购买 nike

我开发了一个 Ionic 应用程序,它在 Windows 上运行良好。我在 VirtualBox 上运行 MacOs El Capitan。我已经在 MacOs 上设置了所有内容,但是当我尝试使用 Ionic Serve 运行该应用程序时,我收到许多在 Windows 上没有的 typescript 错误。

我搜索了很多解决方案,但没有一个能解决我的问题。

这些是错误

[app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts]
';' expected. [app-scripts] L138: function createSpyObj(methodNames: SpyObjMethodNames): any; [app-scripts]
L139: function createSpyObj(methodNames: SpyObjMethodNames): SpyObj; [app-scripts] '(' expected. [app-scripts]
L138: function createSpyObj(methodNames: SpyObjMethodNames): any; [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] L139: function createSpyObj(methodNames: SpyObjMethodNames): SpyObj; [app-scripts] ']' expected. [app-scripts] L138:
function createSpyObj(methodNames: SpyObjMethodNames): any; [app-scripts] L139: function createSpyObj(methodNames: SpyObjMethodNames): SpyObj; [app-scripts] ',' expected. [app-scripts] L138: function createSpyObj(methodNames: SpyObjMethodNames): any; [app-scripts] L139: function createSpyObj(methodNames: SpyObjMethodNames): SpyObj; [app-scripts] Property assignment expected. [app-scripts] L138: function createSpyObj(methodNames: SpyObjMethodNames): any; [app-scripts] L139: function createSpyObj(methodNames: SpyObjMethodNames): SpyObj; [app-scripts] ')' expected. [app-scripts] L138: function createSpyObj(methodNames: SpyObjMethodNames): any; [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138 [app-scripts] [03:55:07] typescript: node_modules/@types/jasmine/index.d.ts, line: 138

最佳答案

使用以下命令重新安装您的应用脚本

npm install @ionic/app-scripts@latest --save-dev

同时运行下面的命令

npm rebuild node-sass

然后运行你的项目,它会正常工作

ionic serve

关于typescript - 在 MacOs 上运行 Ionic 项目后出现大量 TypeScript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54074269/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com