Error / rollbackFailedOptional: verb npm-session

Trying to install Nodered using the command ```
npm install -g --unsafe-perm node-red


Error is rollbackFailedOptional: verb npm session

ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://registry.npmjs.org/node-red failed, reason: connect ECONNREFUSED 10.4.231.104:8080
npm ERR!     at ClientRequest.<anonymous> (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 onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:101:9)
npm ERR!     at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:123:5)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR!  FetchError: request to https://registry.npmjs.org/node-red failed, reason: connect ECONNREFUSED 10.4.231.104:8080
npm ERR!     at ClientRequest.<anonymous> (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 onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:101:9)
npm ERR!     at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:123:5)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:93:5) {
npm ERR!   type: 'system',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   code: 'ECONNREFUSED'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:





I checked the proxy settings and they are correct. Can anyone help me please?

Welcome to the forum.

Can you ping the URL from that machine?

Thank you.

Yes, ping registry.npmjs.org works from that PC.

10.4.231.104 is a non routable address so must be inside your private / work network - so indeed as it says npm cannot reach the registry using http - so something is not correct or your proxy is set to block you or needs more configuration. That will be down to you and your IT department to figure out.

1 Like

Thank you for your input. Our IT team resolved the proxy problems. I have an additiona Q here.

Which command should I run on CentOs so that the Nodered starts automatically after boot and stay active forever?

depends how you installed it. If you used our script then it installs a nodered.service file and you can use sudo systemctl enable nodered.service to enable it. See Starting Node-RED on boot : Node-RED

If not then you can manually install it and setup the systemd file as you wish.

Thank you very much.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.