Skip to content

Creating Vite on Windows

Frank Ako edited this page Jan 5, 2025 · 1 revision

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

To revert to the default policy: Set-ExecutionPolicy Restricted

Reference: https://vitejs.dev

Happy coding! 💻✨

Clone this wiki locally