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

getWslDrivesMountPoint always returns "/mnt/" #242

Closed
mingzz opened this issue Apr 15, 2021 · 1 comment · Fixed by #243
Closed

getWslDrivesMountPoint always returns "/mnt/" #242

mingzz opened this issue Apr 15, 2021 · 1 comment · Fixed by #243

Comments

@mingzz
Copy link
Contributor

mingzz commented Apr 15, 2021

Function getWslDrivesMountPoint always returns the default mount point '/mnt/'. This is due to that fs.constants.F_OK always triggers the exception:

TypeError: Cannot read property 'F_OK' of undefined

According to the documentation of fs, fs.promises does not have constants. So we should probably import constants as well.

@mingzz
Copy link
Contributor Author

mingzz commented Apr 15, 2021

Maybe due to nodejs version. The one I had was node v12.18.2.
fs.promises only has the following properties in node v14 as well:

> const { promises } = require("fs");
undefined
> promises
{
  access: [AsyncFunction: access],
  copyFile: [AsyncFunction: copyFile],
  open: [AsyncFunction: open],
  opendir: [Function: opendir],
  rename: [AsyncFunction: rename],
  truncate: [AsyncFunction: truncate],
  rmdir: [AsyncFunction: rmdir],
  mkdir: [AsyncFunction: mkdir],
  readdir: [AsyncFunction: readdir],
  readlink: [AsyncFunction: readlink],
  symlink: [AsyncFunction: symlink],
  lstat: [AsyncFunction: lstat],
  stat: [AsyncFunction: stat],
  link: [AsyncFunction: link],
  unlink: [AsyncFunction: unlink],
  chmod: [AsyncFunction: chmod],
  lchmod: [AsyncFunction: lchmod],
  lchown: [AsyncFunction: lchown],
  chown: [AsyncFunction: chown],
  utimes: [AsyncFunction: utimes],
  lutimes: [AsyncFunction: lutimes],
  realpath: [AsyncFunction: realpath],
  mkdtemp: [AsyncFunction: mkdtemp],
  writeFile: [AsyncFunction: writeFile],
  appendFile: [AsyncFunction: appendFile],
  readFile: [AsyncFunction: readFile]
}

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 a pull request may close this issue.

1 participant