Node.js Angular CLI UnhandledPromisejection新安装时出现警告

Node.js Angular CLI UnhandledPromisejection新安装时出现警告,node.js,angular,npm,angular-cli,ubuntu-18.04,Node.js,Angular,Npm,Angular Cli,Ubuntu 18.04,我目前正在尝试启动一个新的Angular CLI(v7.1.1)项目,尽管ng new ProjectName,但它似乎正常工作。然后,当我运行ng serve--open命令时,它似乎成功结束,但输出以下警告/错误: $ ng serve --open ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** Date: 2

我目前正在尝试启动一个新的Angular CLI(v7.1.1)项目,尽管
ng new ProjectName
,但它似乎正常工作。然后,当我运行
ng serve--open
命令时,它似乎成功结束,但输出以下警告/错误:

$ ng serve --open
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2018-12-06T20:40:39.900Z
Hash: b89537a5317a31d5ae15
Time: 4712ms
chunk {main} main.js, main.js.map (main) 11.5 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 223 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.3 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.67 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
(node:3844) UnhandledPromiseRejectionWarning: Error: Exited with code 3
    at ChildProcess.cp.once.code (/~path/to/project/node_modules/opn/index.js:84:13)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:978:16)
    at Socket.stream.socket.on (internal/child_process.js:395:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:616:12)
(node:3844) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3844) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
我不知道为什么会发生这种情况,因为我使用的是完全全新的安装,而没有触及cli创建的代码

目前运行ubuntu 18.04、node v11.3.0、npm v6.4.1和angular cli 7.1.1(如上所述)

我还尝试删除和安装node_modules文件夹,但没有成功。看起来是OPN文件导致了这个问题,但我不知道为什么


还有其他人有这个问题吗?

根据GCSDC的评论,我找到了问题所在,或者至少找到了避免错误/警告的方法。这是因为我使用了
--open
,它试图打开网页上的浏览器。。但是,由于运行应用程序的服务器是我通过ssh(和隧道端口)连接到的服务器,因此使用
--open
是没有意义的,这样我们就不再有错误/警告了

很明显,此警告没有出现在angular cli 6.1.5中,该版本先前的。我正在做的项目正在运行


再次感谢GCSDC!:)

根据GCSDC的评论,我找到了问题所在,或者至少找到了避免错误/警告的方法。这是因为我使用了
--open
,它试图打开网页上的浏览器。。但是,由于运行应用程序的服务器是我通过ssh(和隧道端口)连接到的服务器,因此使用
--open
是没有意义的,这样我们就不再有错误/警告了

很明显,此警告没有出现在angular cli 6.1.5中,该版本先前的。我正在做的项目正在运行


再次感谢GCSDC!:)

你试过只运行
ng-serve
ng-serve--open=true
吗?哈哈,我实际上只是试过使用
ng-serve
,它工作起来没有问题。。为什么会这样?为什么《角度初学者指南》建议使用cmd
ng发球——open
。。现在真的很好奇:)?只要仔细阅读,它就完全有道理了。。因为我正在通过ssh隧道连接到运行应用程序的服务器。。所以--open没有意义使用:)不知道为什么在初学者指南上是这样写的,但我总是使用
ng-serve
,对我来说效果很好。你有没有试过只运行
ng-serve
ng-serve--open=true
?哈哈,我实际上只是尝试过使用
ng-serve
,效果很好。。为什么会这样?为什么《角度初学者指南》建议使用cmd
ng发球——open
。。现在真的很好奇:)?只要仔细阅读,它就完全有道理了。。因为我正在通过ssh隧道连接到运行应用程序的服务器。。所以--open没有意义使用:)不知道为什么在初学者指南中是这样写的,但我总是使用
ng serve
,它对我来说很好。