gpt4 book ai didi

node.js - Angular运行错误Object Prototype may only be an Object or null : undefined

转载 作者:太空宇宙 更新时间:2023-11-03 23:50:51 24 4
gpt4 key购买 nike

我的 Angular 应用程序在 package.json 中有几个 npm 依赖项。当我尝试安装 npm 依赖项 npm 时,出现一些 sha1 似乎已损坏的问题。为此,我删除了 package-lock.json,然后我可以成功安装所有 npm 依赖项。但是 npm start 无法运行应用程序,显示错误为

An unhandled exception occurred: Object prototype may only be an Object or null: undefined

错误日志

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 ruf-stable@0.0.0~prestart: ruf-stable@0.0.0
6 info lifecycle ruf-stable@0.0.0~start: ruf-stable@0.0.0
7 verbose lifecycle ruf-stable@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle ruf-stable@0.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\workspace\myworkspace\2020\fis-employee-ui\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_212\bin;C:\Program Files\Java\jre1.8.0_212\bin;C:\Program Files (x86)\MySQL\MySQL Utilities 1.6\;C:\Users\e5608029\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\e5608029\AppData\Local\Programs\Python\Python37\;C:\Users\e5608029\AppData\Local\Microsoft\WindowsApps;C:\Users\e5608029\AppData\Roaming\npm;C:\Users\e5608029\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle ruf-stable@0.0.0~start: CWD: C:\workspace\myworkspace\2020\fis-employee-ui
10 silly lifecycle ruf-stable@0.0.0~start: Args: [ '/d /s /c',
10 silly lifecycle 'ng serve --host 0.0.0.0 --proxy-config proxy.conf.json' ]
11 info lifecycle ruf-stable@0.0.0~start: Failed to exec start script
12 verbose stack Error: ruf-stable@0.0.0 start: `ng serve --host 0.0.0.0 --proxy-config proxy.conf.json`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:182:13)
12 verbose stack at maybeClose (internal/child_process.js:962:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
13 verbose pkgid ruf-stable@0.0.0
14 verbose cwd C:\workspace\myworkspace\2020\fis-employee-ui
15 verbose Windows_NT 10.0.17134
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
17 verbose node v10.15.0
18 verbose npm v6.4.1
19 error file C:\windows\system32\cmd.exe
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error ruf-stable@0.0.0 start: `ng serve --host 0.0.0.0 --proxy-config proxy.conf.json`
23 error spawn ENOENT
24 error Failed at the ruf-stable@0.0.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

最佳答案

删除现有文件后再次尝试 npm install。然后重试 npm start。如果仍然无法正常工作,请尝试通过“ng update @angular/cli @angular/core”命令升级您的项目。你必须像提到的那样做更多的改变here

关于node.js - Angular运行错误Object Prototype may only be an Object or null : undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59550409/

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