問題如下
babel : 無法加載文件 D:\LANCE_SYSTEM_TOOLS\Configuration\Node.js\node_global\babel.ps1,因爲在此係統上禁止運行腳本。有關詳細信息,請參閱 https
:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
babel src -d dist
+ CategoryInfo : SecurityError: () [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
- 如圖
解決方法
- 以管理員身份運行 VSCode
- 執行:
get-ExecutionPolicy
,顯示Restricted
(表示狀態是禁止的) - 執行:
set-ExecutionPolicy RemoteSigned
- 在查看一下:
get-ExecutionPolicy
,顯示RemoteSigned
就可以了 - 如圖