Not able to create project using ServiceNow SDK

Aditya Kumar6
Tera Contributor

Hello All,

 

Like all of you i have been eagerly waiting to try out the new ServiceNow SDK released in the Washington release.  However i have stumbled upon an error while using and i cannot find why this is happening.

 

After Installing the SDK on my local machine i managed to connect to my PDI.

I had been following the video of the SDK demo by the Dev program : https://www.youtube.com/watch?v=7UWC4Pc5Q3E&t=1067s .

After the installation completed i tried to create a new project on my PDI instance (Note: I had successfully managed to connect to my PDI in the CLI using the SDK command lets) however, when typing in the command:

 

C:\Windows\System32>now-sdk create dem_data x_1116108_dem_data --sampleTable

 

i am getting the following error:

 

[now-sdk] Bootstrapping a new ServiceNow application project...
[now-sdk] Attempting to log into instance https://dev183443.service-now.com as admin.
[now-sdk] Generating application files...
× An error occured while running fluent#writing
[now-sdk] [ERROR] Application creation failed due to:
AssertionError [ERR_ASSERTION]: Trying to copy from a source that does not exist: C:\Program Files (x86)\Nodist\bin\node_modules\@servicenow\sdk\node_modules\@servicenow\sdk-cli-core\dist\generator\templates\packageTemplate.json

 

I looked for the file mentioned in this error and i can see it on my local machine : 

Package files under @serviceNow modulePackage files under @serviceNow module

 

The file looks something like this :

 

 

{
    "name": "<%= projectName %>",
    "version": "<%= projectVersion %>",
    "description": "<%= description %>",
    "license": "UNLICENSED",
    "contributors": [],
    "scripts": {
        "build": "now-sdk build",
        "deploy": "now-sdk deploy"
    },
    "now": {
        "scope": "<%= scopeName %>",
        "scopeId": "<%= sysid %>",
        "moduleDir": "src"
    },
    "devDependencies": {
        "@servicenow/glide": "25.0.1",
        "eslint": "8.50.0",
        "@servicenow/eslint-plugin-sdk-app-plugin": "*"
    }
}

 

 

 

Has anyone else faced this while working with the new SDK?  Any pointers highly appreciated 🙂

3 REPLIES 3

Ivan Betev
Mega Sage
Mega Sage

Hi @Aditya Kumar6 ,

 

File is fine, you don't need to change anything there.

 

* Can you reach the folder under the command line window where you execute the create command?

* Try to uninstall nodist and all other nodejs versions and make a clean installation and try it again.

 

I've just tested it under my VS Code and it worked without an issue.

 

Regards, Ivan

btippens2
Tera Contributor

Hi @Aditya Kumar6

One thing that happened to me sometimes is I didn't have root admin by default on my device so could not access all directories. Reinstalling node, etc didn't fix that for me. I still had the issues. Once I added 'sudo' at the beginning of my commands, they worked, although I didn't run into the exact issue you did here, I had some that were similar enough to suggest it. Sudo runs the command as admin. 

Good Luck
Bryan 



driveseedsi
Tera Contributor

To find good locations for family portraits with your Maltipoo puppies, consider factors like lighting (preferably during the golden hour), backgrounds that reflect your family's style, seasonal aesthetics, accessibility, permits if needed, diverse compositions, and personal meaning or sentimentality. Collaborate with your photographer for location suggestions.