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
- Error in header file when calling OpenGL to open obj file in vs2013: unable to open include file: “GL / glut. H”: no such file or directories
- Unable to load file D:: program files (x86) node-v16.4.0-win-x861 because scripts are not allowed to run on this system.
- The browser console reports failed to load resource: net :: ERR_CONNECTION_RESET, which results in unable to log in
- Solution to the problem of console output window’s CMD flashing back when vs2015 writes C + + program
- Solution of vs unable to open source file and link library file
- Debugging failed under vscode Ubuntu, unable to open libc-start. C raise. C, etc
- How to solve the problem of “unable to open include file:” graphics. H “: no such file or directory”
- IntelliSense: unable to open source file ‘StdAfx. H’
- Vs fatal error C1083: unable to open include file: “sys / socket. H”: no such file
- QT creator error: C1083: unable to open include file: “qmediaplayer”
- Solution of unable to open source file “StdAfx. H” in vs2013 / 2012
- Vs2019 OpenGL glut: error: unable to open include file: ‘GL / glut. H’: no such file or directory
- [unable to read project file xxxxx, XXX failed to load project file, name cannot start with “<" character (hex value 0x3c)] exception handling method
- Error: unable to open include file: ‘GL / glut. H’
- IntelliSense in VC + + 2010: unable to open source file “StdAfx. H”
- Error = [Microsoft][SQL Server Native Client 11.0]Unable to open BCP host data-file
- Panda was unable to open the. Xlsx file, xlrd.biffh.XLRDError : Excel xlsx file; not supported
- Unable to open source file in vs