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.

danger local fails to run in WSL

See original GitHub issue

I’ve been trying to migrate to using Danger-JS for some of my projects, however i’m having a hard time running danger in my environment. I am running danger inside of the Windows Subsystem for Linux (WSL), and the compatibility layer there seems to be what is tripping me up in understanding what is going on. The behavior I’m seeing is identical to what is described here: https://github.com/Microsoft/WSL/issues/1774

internal/process/stdio.js:99
        throw new errors.Error('ERR_UNKNOWN_STDIN_TYPE');
        ^

Error [ERR_UNKNOWN_STDIN_TYPE]: Unknown stdin file type
    at process.getStdin [as stdin] (internal/process/stdio.js:99:15)
    at Object.<anonymous> (/home/demi/.nvm/versions/node/v8.0.0/lib/node_modules/danger/node_modules/get-stdin/index.js
:2:20)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/demi/.nvm/versions/node/v8.0.0/lib/node_modules/danger/distribution/commands/danger-ru
nner.js:44:16)

The existing work-around seems to be setting a timeout on the end() call to any stdin, which I’ve tried to add for the instance it gets used in commands/utils/runDangerSubprocess.ts, but was unable to properly verify if that had any impact – I ran yarn link in my checkout of danger then yarn link danger in my project directory, since my understanding is that doing that would allow me to have yarn execute the modified version of danger-js, and not the one it installed into my node_modules/; however that didn’t seem to make a difference. Since I am not familiar with Typescript, or working with Node I wasn’t sure what would be the correct fix or course of action here. I figured the least I could do was document this incompatibility incase others run into it.

OS Info:

Windows 10 1709 (16299.309)

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

Danger Version: 3.2.0 Yarn Version: 1.5.1 Node Version: v8.0.0 and v8.10.0

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
xoredgcommented, Nov 22, 2018

Still happening for me.

0reactions
samdmarshallcommented, Jul 18, 2018

Closing this as it seems like this particular issue has been resolved in a recent update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot access \\wsl$\Ubuntu in Explorer, cannot ... - GitHub
Go to \wsl$ in Explorer; See the Ubuntu directory, click it; Receive an error message "\wsl$\Ubuntu is not accessible. You might not have...
Read more >
Troubleshooting Windows Subsystem for Linux | Microsoft Learn
Restart distribution by typing wsl -t followed by distribution name or run wsl --shutdown either in cmd or PowerShell. Unable to boot after ......
Read more >
Unable to connect to local server on WSL2 from Windows host
I've solved this problem adding port forwarding on Windows. Run this on WSL: ifconfig. The inet IP on eth0 entry is your WSL...
Read more >
Running Sensitive Apps in WSL: (SAFE + SAFE) < SAFE
This blog is intended to be a warning bell and to draw attention to a potential security risk involved in running sensitive applications...
Read more >
Windows Subsystem for Linux (WSL) fails to use DNS from a ...
It appears the WSL BASH shell does not autogenerate the /etc/resolv.conf file correctly, or regenerate it when needed. The result is that DNS...
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