gpt4 book ai didi

angular - 数据路径 '' '' 不应具有其他属性 (es5BrowserSupport)

转载 作者:太空狗 更新时间:2023-10-29 17:08:16 35 4
gpt4 key购买 nike

尝试开始使用 Angular,在 CLI 中创建项目后,我尝试使用 ng serve -onpm start 打开项目,但我得到以下信息错误:

Schema validation failed with the following errors:
Data path "" should NOT have additional properties(es5BrowserSupport)

尝试过:

  • 重新创建具有类似结果的项目
  • 重新安装 CLI

错误日志:

0 info it worked if it ends with ok    1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@6.4.1
3 info using node@v10.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ccctool@0.0.0~prestart: ccctool@0.0.0
6 info lifecycle ccctool@0.0.0~start: ccctool@0.0.0
7 verbose lifecycle ccctool@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle ccctool@0.0.0~start: PATH: C:\ProgramFiles\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\User\Desktop\CCCTool\node_modules\.bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\User\AppData\Roaming\npm;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle ccctool@0.0.0~start: CWD: C:\Users\User\Desktop\CCCTool
10 silly lifecycle ccctool@0.0.0~start: Args: [ '/d /s /c', 'ng serve' ]
11 silly lifecycle ccctool@0.0.0~start: Returned: code: 1 signal: null
12 info lifecycle ccctool@0.0.0~start: Failed to exec start script
13 verbose stack Error: ccctool@0.0.0 start: `ng serve`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid ccctool@0.0.0
15 verbose cwd C:\Users\User\Desktop\CCCTool
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.15.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error ccctool@0.0.0 start: `ng serve`
22 error Exit status 1
23 error Failed at the ccctool@0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

最佳答案

es5BrowserSupport 添加额外的 polyfill

解决方案一

对于选项es5BrowserSupport,您的@angular/cli 需要最低版本7.3@angular-devkit/build-angular 要求最低版本 0.13

  1. 检查您的 @angular/cli 版本。如果小于 7.3 然后运行以下命令

    ng更新@angular/cli

  2. 检查您的 @angular-devkit/build-angular 版本。如果小于 0.13 然后运行以下命令

    ng 更新@angular-devkit/build-angular

方案二

您还可以编辑 angular.json 文件并找到 "es5BrowserSupport": true 并对其进行注释。它也可以在不更新依赖项的情况下工作

关于angular - 数据路径 '' '' 不应具有其他属性 (es5BrowserSupport),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54288766/

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