运行多租户Saas角客户端项目时出错

时间:2018-12-31 06:08:49

标签: angular typescript aspnetboilerplate asp.net-boilerplate

我试图在本地测试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 Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\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\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\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,所以我在本地更新了角度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时,我遵循了thisthis。另外,我确实从here克隆了源项目,并遵循了this准则。记住服务器端核心项目运行成功,我能够看到列出了所有应用程序端点的Swagger Api Index。

1 个答案:

答案 0 :(得分:0)

我从here解决了我的问题。

Angular 6会寻找angular.json而不是angular-cli.json。

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

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

如果要启动您的应用程序或演示应用程序,请遵循以下步骤。如果您要针对生产应用执行此操作,请格外小心。

//更新您的package.json

npm install -g npm-check-updates 

//使用ncu更新程序包// ncu用于显示//用于重写程序包。json

ncu -u

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

ng update @angular/cli

npm install
npm start