CCL1043-K21: Error when scaffolding the component

Ryan Magsam1
Mega Guru

I've went through the steps of installing the ServiceNow CLI, but get this error when I try to scaffold a new UI component.

Command: snc ui-component project --name now-experience-dashboard --description "My First NXF component built at CreatorCon"

Error: Cannot find module 'keytar'

Require stack:

- ~/.snc/.extensions/ui-component/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/keytar-synthesizer.js

I'm running macOs Catalina

I'm running nodeJs version 12.19.0.

I see a version discrepancy with the SNC CLI.  The lab says the current version should be 19.0.0, however the command "snc version" shows that I have version 1.1.0. I just downloaded and installed today, so I'm pretty sure I have the latest version.

Thanks for any help!

Ryan

1 ACCEPTED SOLUTION

Ryan Magsam1
Mega Guru

I found an answer in an older community post.

 

Can simply install the keytar package to resolve.

npm i keytar

But now I have a new error. It seems this lab is more of an exercise in using Now Community.  😄

View solution in original post

11 REPLIES 11

Robert Ninness
ServiceNow Employee
ServiceNow Employee

Hi All,

I had this issue as well when updating the lab from last year's. I had node ~14 already installed on my machine and I tried to go down the rabbit hole of installing keytar / downgrading webpack etc because I had similar errors. Don't bother.

I know the docs say "Node.js version 12.16.1 or greater" This is just wrong. They obviously never tested with "greater" versions of node.

Please use node version 12!


ServiceNow CLI needs a very specific version of Node. That is why I made particular notes in the first exercise on how to setup and use nvm.

 

I'm on an older Mac (2014), this is what I had to do

Robert Ninness
ServiceNow Employee
ServiceNow Employee

Oh I see the confusion with the version numbers. The version of ui-component is 19.0.0 however the version of ServiceNow CLI is 1.0.0

@Ryan Magsam Likely your fix with keytar is the correct one. I can't really confirm unless I go out and buy a new macbook (or blow this one away) as I've already set everything up.

When updating this lab for 21 it was a fresh install on my personal macbook so that I was starting at hopefully a similar environment setting to most people taking the lab.

All I can say is I can't believe they changed the command name from the previous (now-cli) I mean that's not confusing for people already using it‽‽‽ 

 

Yea, changing the command adds a bit of confusion, especially when you're researching older community posts for solutions.

I also noticed that there seemed to a change in direction about installing it. Previously was installed directly from npm, which was nice, but now it's download with three versions (mac, windows, linux) and you have to run a stand-alone installer.  Why?

Dwaine Best
Tera Contributor

I haven't been able to progress with the cli at all because of this error. I've tried installing both a local copy of the servicenow cli and keytar. Using the recommended version of Node (12.16.1). When I try 

snc ui-component project  

I still get

Error: Cannot find module 'keytar'

Are there any other solutions that I might try?

Running OSX Big Sur 11.3 with zsh shell