Question:
Install CNPM on the new computer. When running CNPM-V in VSCODE terminal, the following error will be reported:
CNPM: Unable to load file
C:\Users\Administrator\AppData\ NPM \cnpm.ps1 because script is not allowed to run on this system. For more information, please refer to the
https:/go.microsoft.com/fwlink/?
about_Execution_Policies in LinkID=135170. Position line :1 character :1
cnpm -v+ CategoryInfo : SecurityError: (:) [],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
Solution:
(1) Run VS Code as an administrator and open a terminal in VS Code
(2) Execute Get-ExecutionPolicy at the terminal, displaying Restricted
(3) Update the PowerShell policy and execute it on the terminal: set-executionpolicy RemoteSigned
(4) Examine the status of the policy again and execute: GET-EXECUTIONPOLICY at the terminal to show the RemoteSigned igned
(5) Re-input CNPM-V problem successfully solved
Just taking notes.
Read More:
- Cnpm appears in the vscode terminal: unable to load the file C: \ “users \” gkk \ “appdata \” roaming \ “NPM \” cnpm
- Cnpm: unable to load file
- Angular: Program ng failed to run No application is associated
- How to launch powershell script in C#
- NPM err! Code enotfound (2020-07-03)
- cnpm error Module build failed: Error: No PostCSS Config found in:
- ERROR Plugin load failed: hexo-admin Error: EISDIR: illegal operation on a directory, read ERROR Dep
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Cannot find module ‘lodash’
- Some mistakes in using NPM
- Win10 desktop right click display settings MS- settings:display Or Ms- settings:personalization-background resolvent
- Windows Update Error: 80244019
- Several ways for Ubuntu to open command line terminal window
- Problems that Vue project manager can’t open
- Command failed: NPM install — loglevel error — registry= https://registry.npm.taobao.org
- AES CBC PKCs × 7 encryption
- Failed to create Oracle Oracle home user solution appears in oracle12c installation
- Error: could’t connect to server 127.0.0.1:27017, connection attempt failed
- Windows 8.1 – Fix This app can’t open for Built-in Administrator account
- [tools] vscode debug report G + +. Exe no such file or directory fatal error no input files