Ionic 运行离子项目时出现错误

ekqde3dh  于 2023-09-28  发布在  Ionic
关注(0)|答案(1)|浏览(148)

我想运行离子项目,但得到如下错误:
我已经运行命令为ng serve --port=8100
这是我的命令提示符错误:
E:\IonicProj\Moodle IOS\Moodle> ng serve--port = 8100错误:架构验证失败,出现以下错误:数据路径""不得具有其他属性(stylePreprocessorOptions)。E:\IonicProj\Moodle IOS\Moodle\node_modules@angular\browser\node_modules\rxjs\internal\util\hostReportError. js:4 setError(function(){throw err;},0); [Error]:架构验证失败,出现以下错误:数据路径""不得具有其他属性(stylePreprocessorOptions)。在MapSubscriber。项目(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular\cli\node_modules@angular-devkit\architect\src\architect. js:四十二:27)在MapSubscriber._next(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular\cli\node_modules\rxjs\internal\operators\map. js:四十九:35)在www.example.com(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular\cli\node_modules\rxjs\internal\Subscriber. js:六十六:18)在SafeSubscriber.__tryOrUnsub(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular-devkit\core\node_modules\rxjs\internal\Subscriber. js:二百零五:16)在www.example.com(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular-devkit\core\node_modules\rxjs\internal\Subscriber. js:一百四十三:22、订阅者。_next(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular-devkit\core\node_modules\rxjs\internal\Subscriber. js:八十九:26)在Subscriber.next(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular-devkit\core\node_modules\rxjs\internal\Subscriber. js:六十六:18)在SafeSubscriber.__tryOrUnsub(E:\IonicProj\Moodle IOS\Moodle\node_modules@angular\cli\node_modules\rxjs\internal\Subscriber. js:二百零五:16)在MapSubscriber.Subscriber.next[{instancePath:SafeSubscriber.next'#/additionalProperties',关键字: www.example.com 'stylePreprocessorOptions '},消息:'不得具有其他属性'}]}
我已经运行命令为“离子发球”。this is连续打印行"[INFO] Waiting for connectivity with npm."
这是我的Ionic信息:
‘爱奥尼亚:
Ionic CLI:7.1.1(C:\Users\user101\AppData\Roaming\npm\node_modules@ionic\cli)Ionic Framework:@ionic/angular 6.7.5@angular-devkit/build-angular:15.2.8@angular-devkit/schematics:15.2.8@angular/cli:15.2.8@ionic/angular-toolkit:6.0.0
电容器:
电容器CLI:5.2.3@capacitor/android:5.2.3@电容器/磁芯:5.2.3@capacitor/ios:未安装
cordova :
Cordova CLI:10.0.0(email protected(https://stackoverflow.com/cdn-cgi/l/email-protection))Cordova平台:Cordova插件:不可用
实用程序:
科多瓦-雷斯:0.15.4本地运行:1.7.2
系统名称:
Android SDK工具:26.1.1(C:\Users\itt-sooraj\AppData\Local\Android\Sdk)NodeJS:v16.14.2(C:\Program Files\nodejs\node.exe)npm:操作系统:Windows 10 这是我的Angular 信息:Angular CLI:15.2.8节点:16.14.2包管理器:npm 9.5.0 OS:win32 x64
Angular :15.2.8... animations,cli,common,compiler,compiler-cli,core,forms. platform-browser,platform-browser-dynamic,router |包|版本||― ―|- -|@angular-devkit/architect| 0.1101.2||@angular-devkit/build-angular| 15.2.8||@angular-devkit/core| 15.2.8||@angular-devkit/schematics| 15.2.8||@angular/language-service| 10.0.14||@示意图/Angular |15.2.8||RxJS| 7.4.0||TypeScript| 4.9.5| 我更新了我的ionic,npm和node版本。 我在命令提示符中尝试了很多命令,但没有成功。我运行了下面的命令:ionic serve ng serve --port=8100`
但我还是不能运行代码。
这是我的angular.json文件

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "defaultProject": "app",
  "newProjectRoot": "projects",
  "projects": {
    "app": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "www",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "assets"
              },
              {
                "glob": "**/*.svg",
                "input": "node_modules/ionicons/dist/ionicons/svg",
                "output": "./svg"
              }
            ],
            "styles": [
              {
                "input": "src/theme/theme.scss"
              }
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "optimization": {
                "scripts": false,
                "styles":{
                  "minify": false,
                  "inlineCritical": true
                  } 
              },
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "aot": true, 
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "50mb",
                  "maximumError": "100mb"
                }
              ]
            },
            "ci": {
              "progress": false
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "app:build",
            "disableHostCheck": true,
            "port": 8100
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            },
            "ci": {
              "progress": false
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "app:build"
          }
        },
        "lint": {
          "builder": "@angular-eslint/builder:lint",
          "options": {
            "lintFilePatterns": [
                "src/**/*.ts",
                "src/core/**/*.html",
                "src/addons/**/*.html"
            ]
          }
        },
        "ionic-cordova-build": {
          "builder": "@ionic/angular-toolkit:cordova-build",
          "options": {
            "browserTarget": "app:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            }
          }
        },
        "ionic-cordova-serve": {
          "builder": "@ionic/angular-toolkit:cordova-serve",
          "options": {
            "cordovaBuildTarget": "app:ionic-cordova-build",
            "devServerTarget": "app:serve"
          },
          "configurations": {
            "production": {
              "cordovaBuildTarget": "app:ionic-cordova-build:production",
              "devServerTarget": "app:serve:production"
            }
          }
        }
      }
    }
  },
  "cli": {
    "defaultCollection": "@ionic/angular-toolkit",
    "analytics": "7477caff-90f8-43b7-804c-487c01487e0b"
  },
  "schematics": {
    "@ionic/angular-toolkit:component": {
      "styleext": "scss"
    },
    "@ionic/angular-toolkit:page": {
      "styleext": "scss"
    }
  }
}
gojuced7

gojuced71#

我有这个同样的问题与我的项目时,第一次设置它。在错误消息的第一部分中,它说您不能将stylePreprocessorOptions作为附加属性。(见下文)
E:\IonicProj\Moodle IOS\Moodle>ng serve --port=8100错误:架构验证失败,出现以下错误:数据路径“”不得具有其他属性(stylePreprocessorOptions)。 在项目中搜索stylePreprocessorOptions`并将其从任何文件中删除。如果我没记错的话,它应该在angular.json中。

相关问题