Jon G Lind
ServiceNow Employee
ServiceNow Employee

Since I last worked with the now-cli, aka "snc ui-component", I had started using Yarn instead of NPM on some personal projects.  When I started back work on my latest custom component project I thought "great, let's switch to Yarn!"

 

It mostly seemed to work but when I ran the component locally I got a console error in the browser of "Uncaught ReferenceError: process is not defined" and it seemed like the whole page was locked.  I.e. I could not select an element or fill in a form field.

 

The page is locked and I can't click! Or is it?The page is locked and I can't click! Or is it?

 

The error was actually thrown in an error overlay that was covering the screen (and supposed to be telling me what was wrong but failing).  The real problem was that Yarn and NPM manage packages differently (not sure how, I'm just a hacker) and though node was starting and serving the page some dependencies weren't loading.

 

If you have already made this mistake it's easy to fix--just delete the "node_modules" folder and run "npm install" and you should be good to go.

Are you here because you experienced this yourself?

If so please leave a response to this message.  We at ServiceNow are very interested if any of our customers use package managers other than NPM.

Version history
Last update:
‎03-15-2024 12:45 PM
Updated by:
Contributors