-
Notifications
You must be signed in to change notification settings - Fork 4k
request to http://registry.npmjs.org/@angular-devkit%2fbuild-angular failed, reason: connect ECONNREFUSED 127.0.0.1:4200 #139
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
Comments
Can you detail the exact steps and commands you used? The URL in your message doesn't seem correct. Downloading/installing npm should not be accessing anything from Angular or the angular-devkit. Check out the course here: https://app.pluralsight.com/course-player?clipId=9ae1778f-7d2c-47d9-8dfd-2bd279316dbc |
I have installed node--> checked the version for node and npm.--> changed directory in cmd prompt to the apm start folder --> typed npm install and came up with above error. |
Looks like I got this error now: npm ERR! A complete log of this run can be found in: |
OK. So this isn't a problem with downloading npm and installing node. This is a problem with the install of the application's packages. Looking up the ECONNFEFUSED message, it is a "connection refused by server". This is most likely caused by a firewall, proxy, or other security issue. Are you on a machine that is "locked down" or otherwise restricted access to the internet? If so, you need to ensure npm is set up properly in the proxy config. You could try the steps suggested by your error message:
Or check out the docs here: https://docs.npmjs.com/cli/config Or this article: https://jjasonclark.com/how-to-setup-node-behind-web-proxy/ If none of that works for you, you can instead work through the course using stackblitz, which is an online editor that allows you to build Web applications without having to install anything. You can find the instructions for using stackblitz with this course here: https://github.com/DeborahK/Angular-GettingStarted#stackblitz Let me know if something here helps! |
Hi Deborah, I am working in my corporate office laptop and I tried this, which did not help me: |
Did you have any luck with any of the other resources I listed? Is there a help desk or IT support person that can help? Otherwise, I'd suggest going with my stackblitz suggestion. |
HI Deborah, Also, I would like to mention that earlier I was unable to install other npm packages, but now I am able to do except for these dependiencies. The error that I got after this is:
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"} (current: {"node":"12.18.3","npm":"6.14.6"}) npm ERR! code ELIFECYCLE |
It looks like the packages installed. Most of those are just warnings. What version of node did you install? I'd highly recommend the LTS (Long Term Support) version which is currently 12.18.3. Not the "Current" version which is 14.10.0. In looking at the warning messages, it seems that some of the libraries are not compatible with node 14 at this time. The ending message is saying a post install script didn't work. Are you trying to run this on docker? I'm not sure what the postinstall script all needs to do, but you could try running the app (with npm start) and see if it works without successful completion of the postinstall script. |
I am using v12.18.3 for node and no I am not running this on docker. On npm start command, this is the issue: C:\Users\sroy3\Documents\Angular-GettingStarted-master\APM-Start>npm start
npm ERR! code ELIFECYCLE |
At this point, I see three options:
I've not had anyone run into so many install issues since Angular moved to webpack several years ago. So I don't have a lot of tips to share. :-( |
I have actually tried point 1 and 2. |
So does the install of the Angular CLI generate the same error message? Yes, you can use stackblitz to access a "real" backend server endpoint. We just don't do it in the course because then we'd need to set one up (or depend on an existing one.) I have an example here: https://stackblitz.com/edit/angular-posts-user-todos-forkjoin-deborahk It uses a public "todo" API on a real backend server somewhere. |
Hi,
I am facing this issue on downloading node and then installing npm:
'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://registry.npmjs.org/@angular-devkit%2fbuild-angular failed, reason: connect ECONNREFUSED 127.0.0.1:4200
npm ERR! at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:315:20)
npm ERR! at Socket.socketErrorListener (_http_client.js:426:9)
npm ERR! at Socket.emit (events.js:315:20)
npm ERR! at emitErrorNT (internal/streams/destroy.js:92:8)
npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
npm ERR! at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm ERR! FetchError: request to http://registry.npmjs.org/@angular-devkit%2fbuild-angular failed, reason: connect ECONNREFUSED 127.0.0.1:4200
npm ERR! at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:315:20)
npm ERR! at Socket.socketErrorListener (_http_client.js:426:9)
npm ERR! at Socket.emit (events.js:315:20)
npm ERR! at emitErrorNT (internal/streams/destroy.js:92:8)
npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
npm ERR! at processTicksAndRejections (internal/process/task_queues.js:84:21) {
npm ERR! type: 'system',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! code: 'ECONNREFUSED',
npm ERR! parent: 'APM-Start'
npm ERR! }
The text was updated successfully, but these errors were encountered: