cannot find module 'fs/promise' error in ServiceNow CLI

AJAY BIRADAR
Tera Contributor

Hi Everyone,

I am facing an issue in ServiceNow CLI while developing external custom component and the error is showed in the attachment
does somebody faced this kind of issue?

AJAYBIRADAR_0-1719402313216.png



Thanks,
Ajay 

1 REPLY 1

Philippe Luickx
Tera Contributor

I have the same issue.

➜  foobar snc ui-component project --name @GE/foo-bar --description 'foo'

 project

Creates and scaffolds a new project with all necessary files to start
development.

Options:
  --version      Show version number                                   [boolean]
  --help         Show help                                             [boolean]
  --name         The project name - this should be a valid and unique npm
                 package name.                               [string] [required]
  --description  Project description visible in the npm registry and the
                 ServiceNow Plugins list.                 [string] [default: ""]
  --scope        A scope name to be assigned to this project and its components
                 (limited to 18 characters). If not set, a unique scope name
                 will be generated. Scope name is required in offline mode.
                                                          [string] [default: ""]
  --offline      If set, will not connect to the current host during the
                 scaffolding process, skipping validation.
                                                      [boolean] [default: false]

Error: Cannot find module 'fs/promises'
Require stack:
- /Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.73292 (/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js:3:6761184)
    at r (/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js:3:6987390)
    at Object.27550 (/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js:3:851270)
    at r (/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js:3:6987390)
    at Object.33113 (/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js:3:342141)
    at r (/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js:3:6987390) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/philippe/.snc/.extensions/ui-component/node_modules/@servicenow/cli/dist/servicenow-cli.min.js'
  ]
}

 

Was working a few weeks back, so wondering if an update happened on the package?