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

When running inside a headless process such as within Visual Studio's NPM Task Runner, any ng command throws an error due to process.stdin not being implemented #4870

Closed
ceottaki opened this issue Feb 21, 2017 · 1 comment · Fixed by #4871

Comments

@ceottaki
Copy link
Contributor

OS?

Any Windows, running from VS2015 NPM Task Runner or through one of the project.json scripts

Versions.

@angular/cli: 1.0.0-beta.32.3
node: 6.9.5
os: win32 x64

Repro steps.

  • Set up an app with ng new
  • Add the app to an ASP.NET Core project in VS2015 with outputs set to wwwroot
  • Attempt to run one of the npm scripts using the NPM Task Runner, such as test, which results in the log below

The log given by the failure.

`

ng test
internal/process/stdio.js:82
throw new Error('Implement me. Unknown stdin file type!');
^
Error: Implement me. Unknown stdin file type!
at process.getStdin [as stdin] (internal/process/stdio.js:82:15)
at D:\DEV\PoC\Ang2App\src\Ang2App\node_modules@angular\cli\bin\ng:149:27
at D:\DEV\PoC\Ang2App\src\Ang2App\node_modules\resolve\lib\async.js:45:21
at ondir (D:\DEV\PoC\Ang2App\src\Ang2App\node_modules\resolve\lib\async.js:188:31)
at D:\DEV\PoC\Ang2App\src\Ang2App\node_modules\resolve\lib\async.js:154:39
at onex (D:\DEV\PoC\Ang2App\src\Ang2App\node_modules\resolve\lib\async.js:94:22)
at D:\DEV\PoC\Ang2App\src\Ang2App\node_modules\resolve\lib\async.js:25:18
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\f_ceotto\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "test" "--color=always"
npm ERR! node v6.9.5
npm ERR! npm v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: ng test
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script 'ng test'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ang2-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng test
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ang2-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ang2-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\f_ceotto\AppData\Roaming\npm-cache_logs\2017-02-21T12_04_28_453Z-debug.log

Process terminated with code 1.
`

Mention any other details that might be useful.

This is a common issue with a few packages that use process.stdin when running in Windows. A common solution is to replace the process.stdin with an event emitter when running in a headless environment in Windows and I can submit a pull request that addresses the issue like that, but I've also attached a patch with the same:

fix_win32_process_stdin.patch.txt

ceottaki added a commit to ceottaki/angular-cli that referenced this issue Feb 21, 2017
hansl pushed a commit that referenced this issue Feb 22, 2017
When running in a headless process in win32 the lack of process.stdin throws an error.

Fixes #4870
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
When running in a headless process in win32 the lack of process.stdin throws an error.

Fixes angular#4870
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant