gpt4 book ai didi

angular - 从 Ionic 2 更新到 Ionic 3,现在由于 "Unexpected token {"错误而无法构建

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

完成 Ionic 博客 (detailed here) 中定义的升级步骤后,我无法构建我的 Ionic 项目,因为某处关于无效语法的非常不详细的错误消息。这是完整的错误:

[14:16:31]  ionic-app-script task: "build" 
[14:16:31] SyntaxError: Unexpected token {
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (\node_modules\@angular-devkit\build-optimizer\src\build-optimizer\webpack-loader.js:12:27)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)

我已尝试使用上面的详细信息进行调试,但一无所获。在出现此错误之前,除了上面详述的内容外,我没有进行任何更改(也许我错过了什么?)。有什么想法吗?

package.json

{
"name": "com.myapp.test",
"author": "",
"homepage": "",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"watch": "ionic-app-scripts watch"
},
"dependencies": {
"@angular/common": "4.4.3",
"@angular/compiler": "4.4.3",
"@angular/compiler-cli": "4.4.3",
"@angular/core": "4.4.3",
"@angular/forms": "4.4.3",
"@angular/http": "4.4.3",
"@angular/platform-browser": "4.4.3",
"@angular/platform-browser-dynamic": "4.4.3",
"@ionic-native/core": "4.3.1",
"@ionic-native/splash-screen": "4.3.1",
"@ionic-native/status-bar": "4.3.1",
"@ionic/storage": "2.0.1",
"font-awesome": "4.7.0",
"ionic-angular": "3.7.1",
"ionicons": "3.0.0",
"node-sass": "^4.5.3",
"rxjs": "5.4.3",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.0.0",
"typescript": "2.3.4"
},
"description": "",
"cordovaPlugins": [],
"cordovaPlatforms": [],
"-vs-binding": {
"BeforeBuild": [
"ionic:build"
]
},
"config": {
"ionic_copy": "./config/copy.config.js",
"ionic_sass": "./config/sass.config.js"
}
}

ionic info 的输出

cli packages: (C:\Users\me\AppData\Roaming\npm\node_modules)

@ionic/cli-utils : 1.13.0
ionic (Ionic CLI) : 3.13.0

local packages:

@ionic/app-scripts : 3.0.0
Ionic Framework : ionic-angular 3.7.1

System:

Node : v6.10.3
npm : 4.6.1
OS : Windows 10

Misc:

backend : pro

最佳答案

根据您的Ionic 信息,您没有Android SDK 工具。所以你需要安装它。

我正在使用 Android SDK 工具:25.2.5

你还需要安装cordova

这是我的详细信息:

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

Cordova Platforms  : android 6.2.3

查看如何 setup Ionic 3 environment

关于angular - 从 Ionic 2 更新到 Ionic 3,现在由于 "Unexpected token {"错误而无法构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46716631/

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