我参与了一个项目,在更新脚本后,我发现了这个错误。 好像它无法正确转换HTML文件。 我卸载了离子,将所有内容重新安装到最新版本但仍然出现同样的错误。
模块解析失败:/Users/george/dev/flask/rdan/node_modules/@ionic/app-scripts/dist/webpack/loader.js !/Users/george/dev/flask/rdan/src/pages/ home / home.ts意外的令牌(20:0) 您可能需要适当的加载程序来处理此文件类型。 | @零件({ |选择器:' page-home',模板:/ ion-inline-start:" /Users/george/dev/flask/rdan/src/pages/home/home.html 34; /' \ n \ n \ n
这是我的离子信息。
全球套餐:
@ionic/cli-utils : 1.5.0
Cordova CLI : 7.0.1
Ionic CLI : 3.5.0
本地包裹:
@ionic/app-scripts : 2.0.2
@ionic/cli-plugin-cordova : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.5.3
系统:
Node : v6.10.3
OS : macOS Sierra
Xcode : Xcode 8.3 Build version 8E162
ios-deploy : 1.9.1
ios-sim : 5.0.13
npm : 5.3.0
这是package.json文件
{
"name": "rdan",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.3",
"@angular/http": "4.1.3",
"@angular/platform-browser": "4.1.3",
"@angular/platform-browser-dynamic": "4.1.3",
"@ionic-native/core": "3.12.1",
"@ionic-native/native-audio": "^4.0.1",
"@ionic-native/splash-screen": "3.12.1",
"@ionic-native/status-bar": "3.12.1",
"@ionic/storage": "2.0.1",
"cordova-android": "^6.2.3",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.2",
"ionic-angular": "3.5.3",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"promise-polyfill": "6.0.2",
"rxjs": "5.4.0",
"socket.io-client": "^2.0.3",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"@ionic/app-scripts": "2.0.2",
"@ionic/cli-plugin-cordova": "^1.4.1",
"@ionic/cli-plugin-ionic-angular": "1.3.2",
"typescript": "2.3.4"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {}
},
"platforms": [
"android"
]
}
}
我试过......
npm uninstall -g ionic
npm uninstall cordova -g
rm -rf node-modules
npm install
npm remove -g cordova
sudo npm install -g cordova
有什么想法吗? 注意:对不起我的英文
答案 0 :(得分:0)
错误报告了一个位置(20:0),该文件在home.js文件中被注释掉了,我并没有注意到生成的index.js正在工作等...
最后,我删除了占用这些行的代码(我已经说过这些代码已被评论),并且在两天疯狂的日子之后一切都会再次发挥作用。