Installing Now CLI failed (Now Experience UI Framework)

Belal Salas2
Tera Expert

Hi,

I am trying to install Now CLI using this command:

npm install @servicenow/cli -g

I am getting this error message:

npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/bin/t -> /usr/local/lib/node_modules/@servicenow/cli/src/index.js
/usr/local/bin/now-cli -> /usr/local/lib/node_modules/@servicenow/cli/src/index.js
/usr/local/bin/tectonic -> /usr/local/lib/node_modules/@servicenow/cli/src/index.js

> keytar@5.0.0 install /usr/local/lib/node_modules/@servicenow/cli/node_modules/keytar
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.15.3 runtime=node arch=x64 libc= platform=darwin)
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/@servicenow/cli/node_modules/keytar
gyp ERR! node -v v14.15.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN @octokit/plugin-request-log@1.0.2 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@5.0.0 (node_modules/@servicenow/cli/node_modules/keytar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@5.0.0 install: `prebuild-install || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

 

and when run as root or using sudo, I get this message:

npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/bin/tectonic -> /usr/local/lib/node_modules/@servicenow/cli/src/index.js
/usr/local/bin/t -> /usr/local/lib/node_modules/@servicenow/cli/src/index.js
/usr/local/bin/now-cli -> /usr/local/lib/node_modules/@servicenow/cli/src/index.js

> keytar@5.0.0 install /usr/local/lib/node_modules/@servicenow/cli/node_modules/keytar
> prebuild-install || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, access '/Users/belalsalas/.npm'
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/belalsalas/Library/Caches/node-gyp/14.15.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@servicenow/cli/node_modules/keytar/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@servicenow/cli/node_modules/keytar/.node-gyp'
gyp ERR! System Darwin 20.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/@servicenow/cli/node_modules/keytar
gyp ERR! node -v v14.15.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN @octokit/plugin-request-log@1.0.2 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@5.0.0 (node_modules/@servicenow/cli/node_modules/keytar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@5.0.0 install: `prebuild-install || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ @servicenow/cli@18.0.0
updated 1 package in 55.391s

 

here is some commands and their output:

node -v
v14.15.3

 

npm --version
6.14.9

 

which npm
/usr/local/bin/npm

 

which now-cli
/usr/local/bin/now-cli

 

now-cli --version
internal/modules/cjs/loader.js:883
  throw err;
  ^

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:880:15)
    at Function.resolve (internal/modules/cjs/helpers.js:94: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:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952: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'
  ]
}
This article community question is about same issue but the solutions proposed in it didn't work in my case. 
https://community.servicenow.com/community?id=community_question&sys_id=4deca8de1beb4454fff162c4bd4bcbe0&view_source=searchResult

I am using Mac OS, I appreciate if someone can help.

Thanks
1 ACCEPTED SOLUTION

Hi,
Thanks for the response.
npm i -g keytar run fine but then tried to install the cli again and got same error.

I have found my answer in other community question, here is the link:

https://community.servicenow.com/community?id=community_question&sys_id=070670a4db9810101cd8a345ca961993

long story short: just remove the -g from the command

npm install @servicenow/cli@paris -g
to
npm install @servicenow/cli@paris

this will make the installation locally not globally

 Thanks

View solution in original post

2 REPLIES 2

Narsing1
Mega Sage

Can you try this command to install keytar. Try with sudo if you have permission issue in case if the below command not working.

npm i -g keytar

Once you install that try with this command whether you still getting the error.

now-cli --version

Please mark it as correct answer if it helps.

Thanks,

Narsing

Hi,
Thanks for the response.
npm i -g keytar run fine but then tried to install the cli again and got same error.

I have found my answer in other community question, here is the link:

https://community.servicenow.com/community?id=community_question&sys_id=070670a4db9810101cd8a345ca961993

long story short: just remove the -g from the command

npm install @servicenow/cli@paris -g
to
npm install @servicenow/cli@paris

this will make the installation locally not globally

 Thanks