Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级Node.js 8 之后,npm run dev 会出现问题 #476

Closed
rouwan opened this issue Jun 1, 2017 · 11 comments
Closed

升级Node.js 8 之后,npm run dev 会出现问题 #476

rouwan opened this issue Jun 1, 2017 · 11 comments

Comments

@rouwan
Copy link

rouwan commented Jun 1, 2017

问题:
未处理的promise rejection
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn cmd ENOENT

未处理的promise rejection 将终止Node.js 进程
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.

问题分析:
经过定位,发现是引用的包 opn 中有未捕获的错误导致。
这个错误在之前会打印出 未处理的promise.rejection ,但不会终止进程。
在升级Node.js 8 之后,会终止进程,导致无法正常启动开发服务器

建议:
替换或修复opn包中的未捕获promise rejection

@Binaryify
Copy link

升级到8.1.1可解决问题

@zigomir
Copy link
Contributor

zigomir commented Jun 17, 2017

Thanks @Binaryify!

I actually couldn't do vue init with node 8.1.1, but it seems to be fixed with 8.1.2.

@rouwan does it work for you with newest node?

@rouwan
Copy link
Author

rouwan commented Jun 22, 2017

谢谢~!

@posva posva closed this as completed Jul 11, 2017
@shuaiZend
Copy link

shuaiZend commented Sep 10, 2017

''
[root@localhost index]# node -v
v8.4.0

''
出现这个错误

DONE Compiled successfully in 2570ms 21:43:59

Listening at http://localhost:8080

(node:22397) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3
(node:22397) [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.

直接vue init之后,
运行npm run dev
就提示这个错误,希望得到解决方式。

@shuaiZend
Copy link

fiexd.
1.reinstall nodejs to v6.11
2.npm install webpack
:)

@nevermind123456
Copy link

node一定要是6才可以解决吗?

@dimitrisnl
Copy link

This is really annoying issue. Why should i limit myself to node 6?

@posva
Copy link
Member

posva commented Nov 6, 2017

You can ofc also use a more up to date version 🙂

@dimitrisnl
Copy link

@posva i try 8.9 and it fails.

@SeanBurt
Copy link

node 8.9.3 also has this problem.

@Crips12
Copy link

Crips12 commented Jan 24, 2024

运行npm run dev之后出现(node:7240) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
(Use node --trace-warnings ... to show where the warning was created)
(node:7240) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7240) [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.问题

@vuejs vuejs locked as spam and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants