In this video, I’ll show you how to fix the PowerShell error that says:
npm init playwright@latest --yes "--" . '--quiet' '--browser=chromium' '--browser=firefox' '--browser=webkit' '--gha'
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
npm init playwright@latest --yes "--" . '--quiet' '--browser=chromium ...
~~~
CategoryInfo : SecurityError: (:) [], PSSecurityException
FullyQualifiedErrorId : UnauthorizedAccess
This error appears when you try to install Playwright or run npm commands for the first time on Windows.
It happens because PowerShell blocks script execution by default for security reasons.
To set the execution policy for the current user to RemoteSigned:
=====================================================
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
To verify the change:
=================
Get-ExecutionPolicy
Don’t forget to Like , Share , and Subscribe to SenthilSmartQAHub for more tutorials on Playwright, Selenium, and automation testing.
Learn Playwright Tutorials - • Playwright with Typescript Tutorials
Playwright Automation MCQ Quiz - • Playwright Automation MCQ Quiz Shorts – Te...
Playwright Practical Task : • Daily Playwright Automation Practice – Pra...
JavaScript Interview Questions - • Playlist
#Playwright #AutomationTesting #Screenshot #TestingTutorial #PlaywrightTips #QATraining #SenthilSmartQAHub
#Playwright #npmError #PowerShellError #ExecutionPolicyRestricted #SentinelSmartQAHub #AutomationTesting #QA #Nodejs #npmps1Error #PlaywrightInstallation #SetExecutionPolicy #WindowsPowerShell