0% found this document useful (0 votes)
416 views3 pages

(2) How to Fix _npm _ File C__Program Files_nodejs_npm.ps1 cannot be loaded because running scripts is disabled on this system._ Error _ solution

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
416 views3 pages

(2) How to Fix _npm _ File C__Program Files_nodejs_npm.ps1 cannot be loaded because running scripts is disabled on this system._ Error _ solution

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2

Home My Network Jobs Messaging Notifications Me For Business Post a job

How to Fix "npm : File C:\Program


Files\nodejs\npm.ps1 cannot be
loaded because running scripts is
disabled on this system." Error
Najmul Hasan
Laravel & React.js Developer

July 11, 2024

Today, I encountered a common issue while running an NPM command in


PowerShell:
Error:

File C:\Program Files\nodejs\npm.ps1 cannot be


loaded because running scripts is disabled on this
system.

This happens due to PowerShell’s execution policy settings. Here's a step-


by-step guide to resolve it:

🔧 Solution:
Open PowerShell as Administrator:

Search for "PowerShell" in the Start menu.

Right-click on "Windows PowerShell" and select "Run as


administrator."

Change the Execution Policy:

Allow script execution by running:

Set-ExecutionPolicy RemoteSigned

Confirm the change by typing Y and pressing Enter.

Verify the Execution Policy:

Check the current policy with:


Get-ExecutionPolicy

It should display RemoteSigned.

Run Your NPM Command Again:

Now, execute your npm command:

npm create vite@latest

⚠️ Important: Always be cautious when changing the execution policy.


Only run scripts from trusted sources. To revert to the default policy:

Set-ExecutionPolicy Restricted

Hashtags: #PowerShell #NodeJS #NPM #WebDevelopment #TechTips


#Coding #JavaScript #DevOps #DeveloperCommunity

Reference: https://vitejs.dev

Happy coding! 💻✨

Report this article

You might also like