Nodemon Cannot be Loaded

85 / 100

While trying to run nodemon this error appeared. “Nodemon cannot be loaded

nodemon server.js

It then produced the following error below which was a stumbling block to proceed to the next lesson.

nodemon : File C:\Users\daniel\AppData\Roaming\npm\nodemon.ps1 cannot be loaded because running scripts is disabled on this system. For more
information, see about_Execution_Policies at https:/
At line:1 char:1
+nodemon server.js
+CategoryInfo : SecurityError: (:) [], PSSecurityException
+FullyQualifiedErrorId : UnauthorizedAccess
nodemon cannot be loaded

What lesson for Nodemon?

Learning nodeJS during the free time is interesting. After many years doing Java and now as an IT Manager, there are more time to pick up skills and somehow improve oneself.

I believe in being able to improve oneself and also not only just in soft skills but also technical wise.

Where did I learn NodeJS?

Everything now can be learnt online. There are multiple online platforms to perform these and the one I have been using was Udemy. If you would like to learn too, you can sign up too. Click the banner below or the one on the right to learn indefinitely.

Generic Category (English)640x480

Back to NodeMon Error

Nodemon cannot be loaded

So what actually happened? Basically from the error as mentioned earlier, this is more of a security policy that it is installed on your machine (laptop / desktop computer).

Oh no!! Then what can I do? Here are 2 things you can do!

1. Use node instead of nodemon to run your server

This is the most basic way of starting a server on your nodeJS. Though the reason why we are planning to use nodemon is because we want to automate the server refresh after new codes are inserted.

2. Change the Execution Policy

Do note you can only run this if you have administrator right to your laptop / desktop. If you do not have administrator right or do not have administrator password, then this will not be feasible.

Open Windows PowerShell – Run as Administrator

Set-ExecutionPolicy RemoteSigned

You may refer to the screenshot below for the changes that will happen.

nodemon windows powershell execution policy

Still did not work, what else?

There are many more you can use. Another one would be pm2, which I would not cover here. That’s for another topic to talk about. Which is why javascript projects are very interesting to explore these days.

Till next time and hope the above works for you!

Leave a Reply