question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rmSync is not a function

See original GitHub issue

I get this stack trace on Windows:

$ git peek https://github.com/git-for-windows/git/pull/3017
 Extracting repository to temp folder...
💻 Launched editor in 0.89s
 Finished downloading repository!
🗑  Deleted temp repo
TypeError: u3.default.rmSync is not a function
    at uE (C:\Users\me\AppData\Roaming\npm\node_modules\@jarred\git-peek\bin\git-peek:497:846)
    at s3.run (C:\Users\me\AppData\Roaming\npm\node_modules\@jarred\git-peek\bin\git-peek:528:2695)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
TypeError: u3.default.rmSync is not a function
    at uE (C:\Users\me\AppData\Roaming\npm\node_modules\@jarred\git-peek\bin\git-peek:497:846)
    at s3.run (C:\Users\me\AppData\Roaming\npm\node_modules\@jarred\git-peek\bin\git-peek:528:2695)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

That’s with

$ node -v
v12.16.2

Is it possible that https://github.com/Jarred-Sumner/git-peek/blob/885e324360f00ff030f44fcd99f4ea29f98b459b/src/index.ts#L99 should use await fs.promises.rm() instead (of course, doExit() would then have become async and all the call sites, including this one would have to be adjusted).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Jarred-Sumnercommented, Feb 12, 2021

Yeah the release script broke, I’m fixing it.

1reaction
Jarred-Sumnercommented, Feb 12, 2021

However, it might be much, much easier than that: https://nodejs.org/api/fs.html#fs_fs_rmdirsync_path_options Thanks.

Fixed in v1.1.29. Though I honestly didn’t test that it runs successfully on Node 12, but the diff is so small it seems unlikely to break it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - fs.rmSync throws undefined is not a function on Ubuntu
So it seems like I was using an outdated version of pkg , and since it was taking the global option, it was...
Read more >
Node.js fs.rmSync() Method - GeeksforGeeks
rmSync () method is used to synchronously delete a file at the given path. ... Exceptions will be ignored if the path does...
Read more >
fs.rmSync throws undefined is not a function on Ubuntu-node.js
Coding example for the question fs.rmSync throws undefined is not a function on Ubuntu-node.js.
Read more >
Heroku doesn't like fs.rmSync and promises module ... - Reddit
UnhandledPromiseRejectionWarning: TypeError: fs.promises.rm is not a function. I am not sure why Heroku doesn't like it when I try to delete ...
Read more >
TypeError: fs.readFileSync is not a Function in JS | bobbyhadz
The "fs.readFileSync" is not a function error occurs when we misspell the `readFileSync` method or try to use the method in the browser....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found