SN CLI Generate UI Component cannot find file or directory '.snc/.extensions/ui-component/node_modules/@servicenow/generator-ui-component/lib/generators'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2022 03:07 PM
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:
File Location:
SN CLI Version:
Python, Node, & NPM Version:
Python 2.7.18
OS Version:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 06:51 AM
I have exactly the same issue.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 11:06 AM
Are you on a windows or mac machine?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 11:48 PM
I am on a windows 10 PC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 12:08 AM
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.