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

ci(travis): add Node 14 #59

Closed
wants to merge 3 commits into from
Closed

ci(travis): add Node 14 #59

wants to merge 3 commits into from

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Apr 23, 2020

Node 13 to be deprecated in two months.

temporarily re-added back for debugging, ref hexojs/hexo#4260.

@coveralls
Copy link

coveralls commented Apr 23, 2020

Coverage Status

Coverage remained the same at 96.321% when pulling 0d8ec66 on curbengh:node-14 into 936ef7d on hexojs:master.

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Apr 24, 2020

Confirmed that fs.promises.copyFile behave differently in Node.js 13 and 14

StevenJoeZhang@Mimis-Mac ~ % node
Welcome to Node.js v13.13.0.
Type ".help" for more information.
> fs.promises.copyFile('./test.txt', './test2.txt', {})
Promise { <pending> }
> 
StevenJoeZhang@Mimis-Mac ~ % node        
Welcome to Node.js v14.0.0.
Type ".help" for more information.
> fs.promises.copyFile('./test.txt', './test2.txt', {})
Promise {
  <rejected> TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object
      at Object.copyFile (internal/fs/promises.js:211:10)
      at repl:1:13
      at Script.runInThisContext (vm.js:131:20)
      at REPLServer.defaultEval (repl.js:436:29)
      at bound (domain.js:429:14)
      at REPLServer.runBound [as eval] (domain.js:442:12)
      at REPLServer.onLine (repl.js:763:10)
      at REPLServer.emit (events.js:327:22)
      at REPLServer.EventEmitter.emit (domain.js:485:12)
      at REPLServer.Interface._onLine (readline.js:337:10) {
    code: 'ERR_INVALID_ARG_TYPE'
  }
}
> (node:21528) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object
    at Object.copyFile (internal/fs/promises.js:211:10)
    at repl:1:13
    at Script.runInThisContext (vm.js:131:20)
    at REPLServer.defaultEval (repl.js:436:29)
    at bound (domain.js:429:14)
    at REPLServer.runBound [as eval] (domain.js:442:12)
    at REPLServer.onLine (repl.js:763:10)
    at REPLServer.emit (events.js:327:22)
    at REPLServer.EventEmitter.emit (domain.js:485:12)
    at REPLServer.Interface._onLine (readline.js:337:10)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21528) 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:21528) [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.

https://nodejs.org/dist/latest-v13.x/docs/api/fs.html#fs_fspromises_copyfile_src_dest_mode
https://nodejs.org/dist/latest-v14.x/docs/api/fs.html#fs_fspromises_copyfile_src_dest_mode

@stevenjoezhang
Copy link
Member

Line 211 of the two files below shows the cause of the error. Node.js version 14.0 uses strict parameter type detection.
https://github.com/nodejs/node/blob/v14.0.0/lib/internal/fs/promises.js#L208-L216
https://github.com/nodejs/node/blob/v13.13.0/lib/internal/fs/promises.js#L208-L215

Relevant commit:
nodejs/node@a13500f#diff-0034beae2e92ed0b59570df638dda305

@curbengh
Copy link
Contributor Author

#60

@curbengh curbengh closed this Apr 25, 2020
@curbengh curbengh deleted the node-14 branch April 25, 2020 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants