Skip to content

Can't run netlify dev on wsl2. #2798

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

Closed
simon-carter-tm opened this issue Jun 30, 2021 · 1 comment
Closed

Can't run netlify dev on wsl2. #2798

simon-carter-tm opened this issue Jun 30, 2021 · 1 comment
Labels
type: bug code to address defects in shipped code

Comments

@simon-carter-tm
Copy link

simon-carter-tm commented Jun 30, 2021

Describe the bug

I'm unable to run any commands with netlify on wsl2, getting an error saying it is unable to spawn powershell.exe.

To Reproduce

Steps to reproduce the behavior:

  1. netlify dev
  2. or .node_modules/.bin/netlify dev

Configuration

  • node v12 installed via nvm on wsl2.
  • have tried with node v14 also
  • have tried local and global installs of netlify-cli

current /etc/wsl.conf:

[network]

[automount]
enabled=true

[user]
default=scarter1

# Mount root to /drive/ instead of /mnt/drive for docker compatibility.
root=/

# Unsets (unmasks) -wx bits for group/other so perms don't show up as 777 on WSL.
options="metadata,umask=22,fmask=11"

I've tried adding


[interop]
enabled=false
appendWindowsPath=false

but that didn't work.

npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli

  System:
    OS: Linux 4.19 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 1.49 GB / 4.82 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
    Yarn: 1.22.10 - ~/Development/react-conf-videos/node_modules/.bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
  npmPackages:
    netlify-cli: ^3.39.4 => 3.39.4
  npmGlobalPackages:
    netlify-cli: 3.39.4

Expected behavior

It runs the development server

CLI Output

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ No app server detected and no "command" specified
◈ Using current working directory
◈ Unable to determine public folder to serve files from
◈ Setup a netlify.toml file with a [dev] section to specify your dev server settings.
◈ See docs at: https://cli.netlify.com/netlify-dev#project-detection
◈ Running static server from "react-conf-videos"
◈ Functions server is listening on 33877

◈ Server listening to 3999

/home/scarter1/Development/demoProject/node_modules/netlify-redirector/lib/redirects.js:116
      throw ex;
      ^

Error: spawn /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
  path: '/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAOAA4ADgAOAAiAA=='
  ]
}
@simon-carter-tm simon-carter-tm added the type: bug code to address defects in shipped code label Jun 30, 2021
@simon-carter-tm
Copy link
Author

Was able to do a temp fix by doing export BROWSER=none, from facebook/create-react-app#7251 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

1 participant