错误 运行 多租户 saas angular 客户端项目

Error running multi-tenant saas angular client project

我试图在本地测试 EventCloud 多租户 Saas(.Net Core + Angular SPA),但它抛出了在调试日志文件中发现的这个错误

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\nodejs\node.exe',
1 verbose cli   'C:\Users\myname\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@6.5.0
3 info using node@v10.14.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle EventCloud@0.0.0~prestart: EventCloud@0.0.0
6 info lifecycle EventCloud@0.0.0~start: EventCloud@0.0.0
7 verbose lifecycle EventCloud@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle EventCloud@0.0.0~start: PATH: C:\Users\myname\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\myname\Documents\Projects\EventCloudDemo\eventcloud\aspnet-core-angular\angular\node_modules\.bin;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\GtkSharp.12\bin;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript.0\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\sbt\bin;JAVA_HOME\bin;C:\Program Files\Java\jdk1.8.0_131\bin;C:\android-sdk\bin;C:\CustomLocationForGradle\gradle-4.3-rc-4\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\ManagementStudio\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files (x86)\nodejs\;C:\Users\myname\AppData\Local\Microsoft\WindowsApps;JAVA_HOME\bin;C:\Users\myname\AppData\Local\Microsoft\WindowsApps;;C:\Users\myname\AppData\Local\Programs\Fiddler;C:\Users\myname\AppData\Roaming\npm
9 verbose lifecycle EventCloud@0.0.0~start: CWD: C:\Users\myname\Documents\Projects\EventCloudDemo\eventcloud\aspnet-core-angular\angular
10 silly lifecycle EventCloud@0.0.0~start: Args: [ '/d /s /c', 'ng serve --host 0.0.0.0 --port 4200' ]
11 silly lifecycle EventCloud@0.0.0~start: Returned: code: 1  signal: null
12 info lifecycle EventCloud@0.0.0~start: Failed to exec start script
13 verbose stack Error: EventCloud@0.0.0 start: `ng serve --host 0.0.0.0 --port 4200`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\myname\AppData\Roaming\npm\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:\Users\myname\AppData\Roaming\npm\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 EventCloud@0.0.0
15 verbose cwd C:\Users\myname\Documents\Projects\EventCloudDemo\eventcloud\aspnet-core-angular\angular
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Users\myname\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v10.14.1
19 verbose npm  v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error EventCloud@0.0.0 start: `ng serve --host 0.0.0.0 --port 4200`
22 error Exit status 1
23 error Failed at the EventCloud@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 ]

我已经在本地更新了 angular cli 和 typescript,因为我已经在全局安装了 Angular Cli,但是它说

The serve command requires to be run in an Angular project, but a project definition could not be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! EventCloud@0.0.0 start: `ng serve --host 0.0.0.0 --port 4200`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the EventCloud@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

在更新 Angular Cli 时,我遵循了 and . Also, I did clone source project from here and followed this 指南。请记住,服务器端核心项目成功运行,我能够看到 Swagger Api 索引,其中列出了所有应用端点。

我从 here 解决了我的问题。

Angular 6 查找 angular.json 而不是 angular-cli.json.

您需要更新您的@angular/cli。

我确实使用以下命令更新了所有包并更新了所有依赖项。从而消除与其他软件包的所有兼容性问题。

如果您要启动您的应用程序或演示应用程序,请按照此过程进行操作。如果您对生产应用执行此操作,请格外小心。

//更新你的package.json

npm install -g npm-check-updates 

// 使用 ncu 来更新你的包 // ncu 用于显示 // 用于重写你的 package.json

ncu -u

更新您的@angular/cli 以修改您的应用程序以与 angular 6

兼容
ng update @angular/cli

npm install
npm start