Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Anyone managed to get the new Now-CLI components working?

Mark Edwards3
Kilo Expert

As per the title.  Has anyone managed to get the Now-CLI to install and run successfully?

I've sort of managed to get it working under a Windows machine if, and only if the user account contains no spaces.

However, if I try to install under a *nix box or on my Mac, installation fails if I try to install it globally (even if su'ed in as root) complaining that it cannot locate or install the keytar dependency.

If I attempt to install the package just for the local user, then the installation appears to proceed fine, but on running now-cli --version, I get the following error appear in the console:

Error: Cannot find module 'keytar'
Require stack:
- /usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/keytar-synthesizer.js
- /usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/index.js
- /usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/index.js
- /usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/index.js
- /usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/index.js
- /usr/local/lib/node_modules/@servicenow/cli/src/common/connection-utils.js
- /usr/local/lib/node_modules/@servicenow/cli/src/api/index.js
- /usr/local/lib/node_modules/@servicenow/cli/src/runner/plugin-factory.js
- /usr/local/lib/node_modules/@servicenow/cli/src/runner/index.js
- /usr/local/lib/node_modules/@servicenow/cli/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.resolve (internal/modules/cjs/helpers.js:83:19)
    at rebuildKeytarBindings (/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/keytar-synthesizer.js:23:391)
    at module.exports (/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/keytar-synthesizer.js:23:610)
    at Object.<anonymous> (/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/index.js:23:202)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/keytar-synthesizer.js',
    '/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/credential-manager/index.js',
    '/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/auth/index.js',
    '/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/connection/index.js',
    '/usr/local/lib/node_modules/@servicenow/cli/node_modules/@servicenow/cli-glide/index.js',
    '/usr/local/lib/node_modules/@servicenow/cli/src/common/connection-utils.js',
    '/usr/local/lib/node_modules/@servicenow/cli/src/api/index.js',
    '/usr/local/lib/node_modules/@servicenow/cli/src/runner/plugin-factory.js',
    '/usr/local/lib/node_modules/@servicenow/cli/src/runner/index.js',
    '/usr/local/lib/node_modules/@servicenow/cli/src/index.js'
  ]
}

I've now spent the better part of a day trying to resolve this, and cannot find any way around it, so thought I'd throw it open to the community.

For reference, I'm installing under Node v12.16.1 / npm 6.13.4. on OSX 10.15.3. (but also tried fresh installs of CentOS 7 and Debian 9.

1 ACCEPTED SOLUTION

Mark Edwards3
Kilo Expert

Hmm ... finally managed to get it to install.

However, in order to do so I had to set my umask to 0000 and run the installation as root (rather than via a sudo command), otherwise both the fsevents and keytar modules failed to install (and hence broke the now-cli command)

Of course, in order to now set everything back to a 'safe' configuration, I now have to go back and remove the write access to all the folders and reset my umask back to the previous values.

View solution in original post

10 REPLIES 10

Chuck Tomasi
ServiceNow Employee
ServiceNow Employee

I'm running it fine on my Mac installed in my home directory. Be sure to remove traces of @servicenow from /usr/local/(whatever)

Mac OS 10.14.6

$ node -v

v11.14.0

$ npm --version

6.7.0

$ now-cli --version

Now CLI @17.0.0

$ which node

/usr/local/bin/node

$ which npm

/usr/local/bin/npm

$ which now-cli

/Users/chuck.tomasi/.npm-global/bin/now-cli

Hello,

I managed to create the sample "Hello World" app and when tried to Deploy to SNOW I got some error where it says check the log file however log file is totally blank. But I realised that my instance is updated and I can see my new scopped app.

How can I view this Hello World app inside the Snow?

 

Thanks

Mark Edwards3
Kilo Expert

Hmm ... finally managed to get it to install.

However, in order to do so I had to set my umask to 0000 and run the installation as root (rather than via a sudo command), otherwise both the fsevents and keytar modules failed to install (and hence broke the now-cli command)

Of course, in order to now set everything back to a 'safe' configuration, I now have to go back and remove the write access to all the folders and reset my umask back to the previous values.

Thanks for sharing. Good to know. Hopefully the install can be improved to not have to fiddle with the umask in the future.