Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 views
in Technique[技术] by (71.8m points)

javascript - DeprecationWarning: Calling an asynchronous function without callback is deprecated. - how to find where the "function:" is?

I recently updated my node to 7.2.1 and noticed that there is a warning coming:

(node:4346) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

What is this 4346 for? I only have 2000 lines in the js file, so it can't be a line-number. Where can I find the code?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use either the --trace-deprecation or --throw-deprecation options.

For example:

node --trace-deprecation app.js

or:

node --throw-deprecation app.js

The first option will log a stack trace and the second will throw an error (which, if not caught, will also log a stack trace).

Also, 4346 is most likely the process ID.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...