Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

SN CLI Generate UI Component cannot find file or directory '.snc/.extensions/ui-component/node_modules/@servicenow/generator-ui-component/lib/generators'

Daniel Cudney1
Kilo Contributor

Issue:

I am attempting to make a custom component for the UI Builder. I am following this creatercon course or even this blog post to install the ui-component plugin. I am getting this error when I go to create a new component. It is almost as if the versions are off and are looking for a file in the wrong place.

Any help would be appreciated.

Thank you

Command:

snc ui-component project --name @prefix/component-name --description 'Description' --scope x_prefix_scope_name

(Obviously I renamed some of the values in the command. The command is not the issue)

Error:

find_real_file.png

File Location:

find_real_file.png

SN CLI Version:

find_real_file.png

Python, Node, & NPM Version:

find_real_file.png

Python 2.7.18

OS Version:

find_real_file.png

6 REPLIES 6

Valentin kacser
Tera Contributor

I have exactly the same issue.....

Are you on a windows or mac machine?

I am on a windows 10 PC.

Valentin kacser
Tera Contributor

I think I found a workaround for this:

When creating the project the I got the following errors:

Error: ENOENT: no such file or directory, scandir '[my user profile]\.snc\.extensions\ui-component\node_modules\@servicenow\generator-ui-component\lib\generators'

Error: ENOENT: no such file or directory, scandir '[my user profile]\.snc\.extensions\ui-component\node_modules\@servicenow\generator-ui\lib\generators'

I looked in to the 2 folders and found out that the generators folder is directly in the generatoru-ui-component and gereator-ui folders so I just created a lib folder and copied the generators folder i it.

After that the project gets created without any issues.

I hope this will work for you as well.