Cannot login to prismic-cli

I get an error trying to login to the prismic-cli. From what I can tell, it is because I am working behind a company firewall and all NPM requests have to run through our remote jFrog proxy. I see in the version.js file that you have a version check that reaches out to "registry.npmjs.org" directly. Due to company security policy, that link is blocked internally and we can only access that URL through the remote. This is why it is failing as far as I can tell. Does anyone know any solution to this?

Hey @sdugdale,

I'm checking in with our dev team about this. I'll let you know what they say :slight_smile:

Sam

Hey Shawn,

Our developers published a patch that should fix this. It's prismic-cli version 3.8.10. Could you try it out and let me know if it works?

Thanks,
Sam

I am still unable to login. I cannot even run the prismic api init. Building the project throws an error trying to init the prismic api. It throws the "unable to get local issuer certificate" error.

Here is my new error: still trying to fetch directly from registry.npmjs.org:

Failed to fetch prismic-cli from https://registry.npmjs.org/
(node:71454) UnhandledPromiseRejectionWarning: Error: Unexpected error on URL https://prismic-cli.prismic.io/api
at ClientRequest. (/usr/local/lib/node_modules/prismic-cli/node_modules/prismic.io/lib/requests.js:199:18)
at ClientRequest.emit (events.js:314:20)
at ClientRequest.EventEmitter.emit (domain.js:483:12)
at TLSSocket.socketErrorListener (_http_client.js:427:9)
at TLSSocket.emit (events.js:314:20)
at TLSSocket.EventEmitter.emit (domain.js:483:12)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:71454) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line options | Node.js v15.14.0 Documentation). (rejection id: 1)
(node:71454) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:71454) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined
at _callee$ (/usr/local/lib/node_modules/prismic-cli/bin/commands/index.js:88:63)
at tryCatch (/usr/local/lib/node_modules/prismic-cli/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/prismic-cli/node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.next (/usr/local/lib/node_modules/prismic-cli/node_modules/regenerator-runtime/runtime.js:118:21)
at asyncGeneratorStep (/usr/local/lib/node_modules/prismic-cli/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:5:24)
at _next (/usr/local/lib/node_modules/prismic-cli/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:27:9)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:71454) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line options | Node.js v15.14.0 Documentation). (rejection id: 2)

What exactly was the fix that was implemented for this and does it require something on my end to utilize the fix? Seems that after the latest changes it is still trying to fetch from registry.npmjs.org rather than allowing it to retrieve through the registry that is configured in my npmrc file. As I previously stated, I can not hit registry.npmjs.org directly. It has to go through an enterpise approved virtual registry. @samlittlefair

@samlittlefair @Phil

Colleague of mine dove a little further into why this fix wasn't working for us. He has opened an issue on the github page if you all could take a look at it. He has hacked a fix to that file that gets us moving for now, but obviously we can't move forward with modifying that file directly. Thanks.

Hey @sdugdale ,

Thanks for submitting the issue! That's very helpful. I've flagged it with our dev team, and I'll follow up tomorrow or Monday to let you know what they say.

Sam

1 Like

Hey @sdugdale ,

The dev team looked at the issue and deployed a tentative interim fix. Let me know if that takes care of the issue on your end.

Sam

Awesome, we will check it out. Thanks.