Unable to install ServiceNow CLI from command prompt -> npm install @servicenow/cli@quebec

Hi Team,

I have a project requirement to install ServiceNow "now-cli" on VDI to create and deploy custom UI components directly to ServiceNow and manage ServiceNow instance. 
I have tried several times with other members of our team but we are getting errors. We have followed other resolution steps for temporarily resolving proxy issue with "npm config set strict-ssl false" command.

We are getting below errors:

C:\Windows\System32>npm install @servicenow/cli@quebec
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 link1
npm WARN deprecated resolve-url@0.2.1: link2
npm WARN deprecated request@2.88.2: link3
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See link4
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

> keytar@5.0.0 install C:\Windows\System32\node_modules\keytar
> prebuild-install || node-gyp rebuild

prebuild-install WARN install unable to get local issuer certificate

C:\Windows\System32\node_modules\keytar>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:397:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:409:5)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\System32\node_modules\keytar
gyp ERR! node -v v14.17.6
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

> core-js@3.18.1 postinstall C:\Windows\System32\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js  for polyfilling JavaScript standard library!

> ejs@2.7.4 postinstall C:\Windows\System32\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool 


> spawn-sync@1.0.15 postinstall C:\Windows\System32\node_modules\spawn-sync
> node postinstall


> yo@3.1.1 postinstall C:\Windows\System32\node_modules\yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
ErrorClass [RequestError]: unable to get local issuer certificate
    at ClientRequest.<anonymous> (C:\Windows\System32\node_modules\latest-version\node_modules\got\index.js:73:21)
    at Object.onceWrapper (events.js:520:26)
    at ClientRequest.emit (events.js:400:28)
    at ClientRequest.emit (domain.js:470:12)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at TLSSocket.emit (domain.js:470:12)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
  host: '`registry.npmjs.org`',
  hostname: `'registry.npmjs.org`',
  method: 'GET',
  path: '/yo'
}
× yo version
ErrorClass [RequestError]: unable to get local issuer certificate
    at ClientRequest.<anonymous> (C:\Windows\System32\node_modules\latest-version\node_modules\got\index.js:73:21)
    at Object.onceWrapper (events.js:520:26)
    at ClientRequest.emit (events.js:400:28)
    at ClientRequest.emit (domain.js:470:12)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at TLSSocket.emit (domain.js:470:12)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
  host: `'registry.npmjs.org`',
  hostname: '`registry.npmjs.org`',
  method: 'GET',
  path: '/yo'
}
√ npm version

Found potential issues on your machine :(
npm WARN saveError ENOENT: no such file or directory, open 'C:\Windows\System32\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\System32\package.json'
npm WARN @octokit/plugin-request-log@1.0.4 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
npm WARN System32 No description
npm WARN System32 No repository field.
npm WARN System32 No README data
npm WARN System32 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@5.0.0 (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@19.0.0
added 1559 packages from 532 contributors and audited 1585 packages in 104.091s

83 packages are looking for funding
  run `npm fund` for details

found 173 vulnerabilities (57 low, 31 moderate, 85 high)
  run `npm audit fix` to fix them, or `npm audit` for details

It will be helpful if I may get any advise on how to resolve this while we are looking into installing node-gyp and windows-build-tools as next step. Thanks

Your error messages basically tells you why it is not working. You have to install Python. But I don’t know if there will be any further issues. If you have trouble installing it, you should probably ask for help on their repository page or find an appropriate discord server.