angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng serve error 'This socket is closed'

Open nintschger opened this issue 10 years ago • 30 comments

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.19-3 node: 7.1.0 os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

First it wasn't working on my already existing project. I tried it with a test-project created with ng new, but still the same error.

The log given by the failure.

Normally this include a stack trace and some more information.

events.js:160
       throw er; // Unhandled 'error' event
       ^
 
 Error: This socket is closed
     at WriteStream.Socket._writeGeneric (net.js:683:19)
     at WriteStream.Socket._write (net.js:734:8)
     at doWrite (_stream_writable.js:334:12)
     at writeOrBuffer (_stream_writable.js:320:5)
     at WriteStream.Writable.write (_stream_writable.js:247:11)
     at WriteStream.Socket.write (net.js:661:40)
     at WriteStream.process.stderr.write (C:\Users\nino_\Documents\Angular\Projects\test_project\node_modules\angular-cli\lib\cli\index.js:32:27)
     at Console.warn (console.js:51:16)
     at printErrorAndExit (C:\Users\nino_\Documents\Angular\Projects\test_project\node_modules\awesome-typescript-loader\node_modules\source-map-support\source-map-support.js:406:11)
     at process.emit (C:\Users\nino_\Documents\Angular\Projects\test_project\node_modules\awesome-typescript-loader\node_modules\source-map-support\source-map-support.js:419:16)
     at process._fatalException (bootstrap_node.js:292:26)

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

nintschger avatar Nov 10 '16 15:11 nintschger

I get the same error when I run ng init - the command hangs, after manually exiting it returns the same message

manwaring avatar Nov 10 '16 18:11 manwaring

Im also getting the same error too. I really hope it's nothing any our end.

ghost avatar Nov 10 '16 19:11 ghost

I am also having this error. (Windows 10 x64)

nullhart avatar Nov 10 '16 21:11 nullhart

It looks like the cause might be in Node 7.1.0 itself: https://github.com/nodejs/node/issues/9542

manwaring avatar Nov 11 '16 03:11 manwaring

I am also having this error. started after i installed node 7.1. My project was fine until this.

Marianogboo avatar Nov 11 '16 08:11 Marianogboo

I had the same problem, got it fixed by uninstall node 7.1.10 and installed node 6.9.1 LTS and it works...

Nhiyhe avatar Nov 11 '16 09:11 Nhiyhe

Nhiyhe is right, after installing the node 6.9.1 LTS it's all good!

alberthoekstra avatar Nov 13 '16 16:11 alberthoekstra

can confirm that as well.

nintschger avatar Nov 13 '16 17:11 nintschger

is the issue really in NodeJS ? or should Angular CLI be updated ? seems to work in company without angular cli to serve either Angular 1.x or React

tebeco avatar Nov 14 '16 12:11 tebeco

i have nodejs : 7.1.0 npm : 3 and install npm install -g angular-cli just now and i have the same error when write command : ng serve so what is the solution plz :(

OdaiTu avatar Nov 14 '16 14:11 OdaiTu

lol

the problem resloved by uninstall the node :7.1.0 and install the node :6.9.1 but i think this is not the right solution guys

OdaiTu avatar Nov 14 '16 14:11 OdaiTu

Same problem - resolved by reverting to node 6.9.1

kylecollie avatar Nov 15 '16 05:11 kylecollie

Same problem. Dont want to revert to node 6.9.1. Please quickfix

uucly avatar Nov 15 '16 13:11 uucly

node v7.1.0 and same problem

seveves avatar Nov 15 '16 16:11 seveves

same problem with v7.1.0

PacejetRepository avatar Nov 16 '16 08:11 PacejetRepository

Reverted back to v6.9.1 LTS and errors gone. Very critical error on release

PacejetRepository avatar Nov 16 '16 09:11 PacejetRepository

Same Problem with 7.1

brendon-colburn avatar Nov 17 '16 00:11 brendon-colburn

Same problem here, I had to revert to Node 6.9.1 (Win10-x64)

When I reinstalled angular-cli I notice the following WARNING. Might our problem be related to this in someway?

$>npm install -g angular-cli npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

Thanks in advance for your hard work.

davidema79 avatar Nov 17 '16 16:11 davidema79

Same Problem here with 7.1

cubidobusinesssolutions avatar Nov 18 '16 14:11 cubidobusinesssolutions

Thanks @ironmanwaring! Reverted to v6.9.1 and things went back to normal!

vmourac avatar Nov 19 '16 18:11 vmourac