snc ui-component develop command throws "Response code 401 (Unauthorized)" error

Laci1488
Tera Contributor

Hi, I've tried to develop a custom component for UI Builder with ServiceNow Cli. I met the following error in Visual Studio Code, when I wanted to create a code and test it with snc ui-component command: 

Laci1488_0-1707212484784.png

I've succesfully created a project with cli, a used npm install command and as you can see, I've used a custom profile with an admin user for it and succesfully login in my instance in the command with it. But after that the snc ui-component develop threw a 401 response code error, so i don't understand why. node version: 14.0.0, npm 6.14.8, ui-component 24.0.1 and cli 1.1.0. Maybe an error in my instance?(It is alive and not hibernated)

2 REPLIES 2

Gary Fawcett1
Tera Guru

Yep I'm starting to believe this can't be done.


I have followed this new process, but same result 😞
https://docs.servicenow.com/bundle/washingtondc-application-development/page/build/components/task/s...

DYCM
Mega Sage

Hi @Laci1488 ,

Please try the following steps:

# First time running snc, following configuration steps need to be followed
snc configure profile set 
Host: https://<your-instance>.service-now.com 
Login Method (Basic,OAuth,OAuth+MFA): Basic 
Username: your-username 
Password: your-password
# Above steps will generate a config file, path is as below
* Linux and Mac: ~/.snc/config.json
* Windows: %USERPROFILE%\.snc\config.json

# As long as above config file generated, no need to execute above steps in the future, just use following command to connect to an instance
snc ui-component login https://<your-instance>.service-now.com --username=your-username --password=your-password

# Create your project
snc ui-component project --name @mycompany/project-name --description "project description"

# Install package
npm install

# Debug on your local
snc ui-component develop --open

# Deploy to your instance
snc ui-component deploy -f