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

AngularJS 2 CLI - "ng serve" stdin error #9

Open
STNME opened this issue Oct 28, 2016 · 3 comments
Open

AngularJS 2 CLI - "ng serve" stdin error #9

STNME opened this issue Oct 28, 2016 · 3 comments

Comments

@STNME
Copy link

STNME commented Oct 28, 2016

Installed product versions

  • Visual Studio: 2015 Professional
  • This extension: 1.2.32

Description

AngularJS 2 ng commands are throwing an error regarding stdin.

Steps to recreate

  1. Install VS NodeJS project plugin from https://visualstudiogallery.msdn.microsoft.com/68faf8ac-b953-42f5-a908-55555deccf7a
  2. Create a new NodeJS project
  3. Add a commands.json file. "FileName": "cmd.exe", Arguments": "/c npm start". This calls "ng serve" which is the AngularJS 2 CLI command that starts WebPack.

Current behavior

Here is the output:

ng serve
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
at C:...\node_modules\angular-cli\bin\ng:38:27
at C:...\node_modules\resolve\lib\async.js:44:21
at ondir (C:...\node_modules\resolve\lib\async.js:187:31)
at C:...\node_modules\resolve\lib\async.js:153:39
at onex (C:...\node_modules\resolve\lib\async.js:93:22)
at C:...\node_modules\resolve\lib\async.js:24:18
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! Windows_NT 6.1.7601
Process terminated with code 1.
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! web-ui@0.0.0 start: ng serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web-ui@0.0.0 start script 'ng serve'.
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 web-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs web-ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls web-ui
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:...\npm-debug.log

Expected behavior

The ng serve command works OK from a manual CMD prompt, and it would be very handy if it worked from VS. BTW I get the same error with the NPM Task Runner.

@madskristensen
Copy link
Owner

It's probably due to VS using a 32 bit version of node.exe by default in VS 2015. Try to use your own version of node, but moving the PATH up like explained here https://blogs.msdn.microsoft.com/webdev/2015/03/19/customize-external-web-tools-in-visual-studio-2015/

@STNME
Copy link
Author

STNME commented Oct 28, 2016

I appreciate the fast response. I had already made that adjustment, and the error output verifies that freshly-installed Node v6.9.1 is being used. Is the Angular 2 CLI expecting Standard In and it's not defined for some reason? From a command prompt, I can type in "start npm start", and that opens a new command prompt and runs the npm command OK.

@ceottaki
Copy link

I found this while trying to solve the same issue myself, and I've just submitted a pull request to the angular-cli project to address it: angular/angular-cli#4871

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

No branches or pull requests

3 participants