'How to enable npm-check?
I am having a problem with the npm-check
package that I installed.
I already installed it globally, and when I try to run npm-check
it says:
npm-check.ps1 cannot be loaded because running scripts is disabled on this system.
Here is the full error message
I did try to go to the link provided and watch some tutorials. But I was afraid because it involves the registry.
Solution 1:[1]
To run npm check here, you would need to run /path/to/.bin/npm-check
If you wan to run from npm-check
you must need to installed it globally first.
npm install -g npm-check
Solution 2:[2]
If you're using Windows Server 2008 R2 then there is an x64 and x86 version of PowerShell both of which have to have their execution policies set. Did you set the execution policy on both hosts?
As an Administrator, you can set the execution policy by typing this into your PowerShell window:
Set-ExecutionPolicy RemoteSigned
For more information, see Using the Set-ExecutionPolicy Cmdlet.
When you are done, you can set the policy back to its default value with:
Set-ExecutionPolicy Restricted
You may see an error:
Access to the registry key
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied.
To change the execution policy for the default (LocalMachine) scope,
start Windows PowerShell with the "Run as administrator" option.
To change the execution policy for the current user,
run "Set-ExecutionPolicy -Scope CurrentUser".
So you may need to run the command like this (as seen in comments):
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | shourov_return0 |
Solution 2 | Areg Nikoghosyan |