# Cannot login to prismic-cli

**URL:** <https://community.prismic.io/t/cannot-login-to-prismic-cli/4830>\
**Category:** Developing with Prismic\
**Tags:** nodejs\
**Created:** [April 5, 2021, 8:31pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830 "2021-04-05T20:31:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdugdale](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sdugdale](https://community.prismic.io/u/sdugdale)\
**Post date:** [April 5, 2021, 8:31pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/1 "2021-04-05T20:31:55Z")

</div>

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](http://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?

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [April 7, 2021, 9:18am UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/4 "2021-04-07T09:18:19Z")

</div>

Hey @sdugdale,

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

Sam

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [April 7, 2021, 4:40pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/5 "2021-04-07T16:40:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sdugdale](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sdugdale](https://community.prismic.io/u/sdugdale)\
**Post date:** [April 8, 2021, 12:25am UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/6 "2021-04-08T00:25:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sdugdale](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sdugdale](https://community.prismic.io/u/sdugdale)\
**Post date:** [April 8, 2021, 2:42pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/7 "2021-04-08T14:42:49Z")

</div>

Here is my new error: still trying to fetch directly from [registry.npmjs.org](http://registry.npmjs.org):

Failed to fetch prismic-cli from [https://registry.npmjs.org/](https://registry.npmjs.org/)  
(node:71454) UnhandledPromiseRejectionWarning: Error: Unexpected error on URL [https://prismic-cli.prismic.io/api](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](https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)). (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](https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)). (rejection id: 2)

---

<div class="post-metadata">

**Author:** ![sdugdale](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sdugdale](https://community.prismic.io/u/sdugdale)\
**Post date:** [April 12, 2021, 2:36pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/8 "2021-04-12T14:36:46Z")

</div>

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](http://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](http://registry.npmjs.org) directly. It has to go through an enterpise approved virtual registry. @samlittlefair

---

<div class="post-metadata">

**Author:** ![sdugdale](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sdugdale](https://community.prismic.io/u/sdugdale)\
**Post date:** [April 15, 2021, 4:42pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/9 "2021-04-15T16:42:53Z")

</div>

@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.

> <https://github.com/prismicio/prismic-cli/issues/87>
>
> Tracking down an issue we have been having relating to using Prismic behind a JFrog AF instance. The issue we had...

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [April 15, 2021, 6:21pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/10 "2021-04-15T18:21:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [April 16, 2021, 6:22am UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/11 "2021-04-16T06:22:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sdugdale](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sdugdale](https://community.prismic.io/u/sdugdale)\
**Post date:** [April 16, 2021, 7:19pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/12 "2021-04-16T19:19:41Z")

</div>

Awesome, we will check it out. Thanks.

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [April 29, 2021, 4:26pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/13 "2021-04-29T16:26:25Z")

</div>

This issue has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 4:22pm UTC](https://community.prismic.io/t/cannot-login-to-prismic-cli/4830/14 "2021-12-09T16:22:20Z")

</div>


