Ionic 架构验证失败,错误如下

9w11ddsr  于 2022-12-08  发布在  Ionic
关注(0)|答案(4)|浏览(160)

我知道有很多这样的问题,但我的,我想我还没有看到,当建立我的Android平台,这个错误附加。

Schema validation failed with the following errors:
 Data path ".scripts[0]" should NOT have additional properties(lazy).
 Data path ".scripts[0]" should be string.
 Data path ".scripts[0]" should match exactly one schema in oneOf.
[ERROR] An error occurred while running subprocess ng.

所以我怎么才能弄清楚呢???拜托

fnatzsnv

fnatzsnv1#

在angular.json文件中,如果你有一个空的脚本标签,就像这样,只要删除它!

"build": {
      "options": {
       ....,
       "scripts": []      <-- Remove this line
m0rkklqb

m0rkklqb2#

当我从@angular-devkit/build-angular版本~0.900.0-rc.3移到^0.1100.2版本时,我遇到了同样的错误。在package.json中设置以下配置解决了我的问题:

"@angular-devkit/build-angular": "~0.900.0-rc.3",
hs1rzwqc

hs1rzwqc3#

I think this error might be happening due to new syntax for script tag in angular.json . Please find and update this tag (might be more than one) and update it accordingly to the new syntax:

"scripts": [
   {
      "input": "a.js",
      "input": "b.js"
   }
],
b1uwtaje

b1uwtaje4#

For IONIC you can follow these steps :

  1. Remove node_modules and package-lock.json .
  2. npm cache clean --force
  3. npm install .
  4. Now try to run, if it didn't work go for the next step.
  5. npm i -g npm-check-updates
  6. ncu -u
  7. ionic cordova platform rm android .
  8. ionic cordova platform add android .
  9. npm install .

相关问题