Saas Connector - Error While running spcx Command

Hello,

I am trying to build Saas connector and started with bare minimum default which gets auto created via CLI. When I am running ‘npm run dev’ it is throwing below error:

ppal02@ML-YNWJ3PW4XM DemoConnector % npm run dev

[email protected] dev
cross-env NODE_OPTIONS=–enable-source-maps spcx run dist/index.js

node:events:490
throw er; // Unhandled ‘error’ event
^

Error: listen EADDRINUSE: address already in use :::3000
at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
at __node_internal_uvExceptionWithHostPort (node:internal/errors:589:12)
at Server.setupListenHandle [as _listen2] (node:net:1774:16)
at listenInCluster (node:net:1822:12)
at Server.listen (node:net:1910:7)
at Function.listen (/Users/ppal02/Desktop/DemoConnector/node_modules/express/lib/application.js:635:24)
at runDev (/Users/ppal02/Desktop/DemoConnector/node_modules/@sailpoint/connector-sdk/bin/spcx.ts:153:6)
at Object. (/Users/ppal02/Desktop/DemoConnector/node_modules/@sailpoint/connector-sdk/bin/spcx.ts:32:2)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions…js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
Emitted ‘error’ event on Server instance at:
at emitErrorNT (node:net:1801:8)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: ‘EADDRINUSE’,
errno: -48,
syscall: ‘listen’,
address: ‘::’,
port: 3000
}

Node.js v19.8.1

Can anyone help me why this error is coming without making any changes.
PS: I have all the re-requisite installed.

Thanks,
Pooja

It looks like you already have a service on your machine that is running on port 3000. Did you inadvertently start two instances of the saas connector, or do you have another service on your machine running on port 3000?

Yes, seems another try of Saas connector I did on my local.Where I can change the port?

This seems sorted if I run npm run dev with port number but while deploying the connector I am getting below error:
ppal02@ML-YNWJ3PW4XM DemoConnector % sail conn create DemoConnector
Error: failed to retrieve access token. status 401 Unauthorized

The environment I set was correct and the similar client id and client secret I can use to make API calls via postman.

Are you able to run the sail conn list command? If not, it’s possible you just need to configure your credentials properly for the CLI. See some examples for doing this here: CLI | SailPoint Developer Community