相关疑难解决方法(0)

为什么我突然得到: ng : File C:\Users\d\AppData\Roaming\npm\ng.ps1 无法加载

多年来我一直愉快地使用 vscode/angular/node/npm ,没有出现任何问题。突然在最后一个小时左右,没有明确更改任何内容,我收到以下错误。

先前存在的执行权限突然丢失的最可能原因是什么?

我不想提前说这些,但对于那些无法理解的人,我并不是在问如何修复错误。我问为什么我的权限被擦除导致它出现。

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\d> cd C:\source\my-WebApp
PS C:\source\my-WebApp> ng serve
ng : File C:\Users\d\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file
C:\Users\d\AppData\Roaming\npm\ng.ps1 is not digitally signed. You cannot run this script on the current system.
For more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ng serve
+ ~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException …
Run Code Online (Sandbox Code Playgroud)

npm visual-studio-code angular

11
推荐指数
1
解决办法
3万
查看次数

'electron-packager'不被视为内部或外部命令

我最近开始使用电子.我通过创建一个hello world app(包含文件index.html,main.js,package.json)成功完成了第一阶段.现在我正在尝试使用电子打包器打包应用程序,但收到此错误

电子包装器错误

我遵循的步骤:

  1. 创建了一个名为helloworld的项目目录.
  2. 使用npm init命令初始化项目目录.
  3. 然后安装电子使用npm install electron --save-dev.
  4. 然后分别将javascript和html文件创建为main.js和index.html.
  5. 然后用于npm start执行应用程序.
  6. 然后安装电子包装器使用npm install electron-packager.
  7. 现在,当我尝试使用命令来破坏app时,问题就出现了 electron-packager .

npm electron electron-packager

10
推荐指数
2
解决办法
1万
查看次数

提供 ng 服务时出现 CLI 错误

ng : File C:\Users\Lenovo\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file C:\Users\Lenovo\AppData\Roaming\npm\ng.ps1 is not digitally signed. You cannot run 
this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ng serve
+ ~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)

在给 ng 服务时显示此错误..如何克服它?

angular

10
推荐指数
3
解决办法
8329
查看次数

在Windows7中启用/禁用ClearType

嗨我需要启用/禁用Cleartype(或"调整Windows的外观和性能>屏幕字体的平滑边缘")通过cmd(或任何脚本,如VBS/JS)或从注册表无需注销或Windows重新启动.

可能只为一个应用程序启用ClearType

谢谢

registry command-line cleartype windows-7

9
推荐指数
3
解决办法
3万
查看次数

Visual Studio Code 未签名 Powershell 脚本

我开始使用 Visual Studio Code 进行 Powershell 脚本编写。我想关闭对未签名代码的检查,但不知道如何执行此操作。我也没有在论坛上找到任何东西。

powershell visual-studio-code

8
推荐指数
4
解决办法
2万
查看次数

Cassandra Powershell问题

我正试图在我的Windows笔记本电脑上启动Cassandra,我看到以下错误:

WARNING! Powershell script execution unavailable
Please use 'powershell Set-ExecutionPolicy Unrestricted'
   on this user-account to run cassandra with fully featured
   functionality on this platform.
Starting with legacy startup options
Starting Cassandra Server
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Run Code Online (Sandbox Code Playgroud)

所以我打开Powershell尝试将ExecutionPolicy设置为Unrestricted,我得到以下内容:

来自powershell的错误

所以我按照错误中描述的注册表项进行操作,似乎密钥已经正确设置.我只是缺少一些明显的东西吗?以前版本的Cassandra在我的机器上完美运行,但自从我更新以来,这给了我各种各样的问题.

windows powershell cassandra

7
推荐指数
2
解决办法
8801
查看次数

ngserve --open 无法从 Powershell 和 VS 终端(Powershell)工作

当我遇到这个问题时,那时我已经尝试从 Pwershell 触发此命令,无论是管理员还是非管理员

得到这个错误:

''' ng :无法加载文件 C:\Users\vishi\AppData\Roaming\npm\ng.ps1,因为在此系统上禁用运行脚本。有关详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=135170 上的 about_Execution_Policies。行:1 字符:1

  • ng 服务 --open
    • 类别信息:安全错误:(:) []、PSSecurityException
    • FullQualifiedErrorId:未经授权的访问“”

然后我尝试从 CMD 运行,因为此问题是由于 Powershell 上应用的安全策略造成的,然后 CMD 显示此错误:

'''新命令需要在项目外部运行,但在 C:\Users\vishi\ImprovApp\angular.json 中找到了项目定义”。'''

我的问题是,如果我们不是管理组的一部分,那么我们无法更改 PS 安全策略,那么还有其他方法可以运行 nodejs Ng 或 npm 命令吗???

windows powershell visual-studio angular-cli

7
推荐指数
1
解决办法
4780
查看次数

Azure PowerShell无法连接

我按照MS说明下载并安装了Azure Powershell:https: //azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

使用Windows Powershell ISE我运行命令:

登录-AzureRmAccount

返回错误:

Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.Profile', but the  module could not be loaded. For more information, run 'Import-Module AzureRM.Profile'. At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Run Code Online (Sandbox Code Playgroud)

导入模块AzureRM.Profile

返回此错误:

Import-Module : File C:\Program Files (x86)\Microsoft 
SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\CheckVersions.ps1 cannot be loaded 
because running scripts is disabled on this system. For more information, see about_Execution_Policies at 
http://go.microsoft.com/fwlink/?LinkID=135170.
At …
Run Code Online (Sandbox Code Playgroud)

powershell azure azure-powershell

6
推荐指数
1
解决办法
1万
查看次数

Nodemon 命令不起作用未经授权的访问

我正在尝试运行 nodemon,但是当我这样做时,它会出现以下错误:

nodemon : File C:\Users\dyzha\AppData\Roaming\npm\nodemon.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
+ nodemon app.js
+ ~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityExcep  
   tion
    + FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)

我已经尝试卸载它并重新安装它,npm install -g nodemon并且npm install nodemon --save-dev

javascript nodemon

3
推荐指数
1
解决办法
5822
查看次数

激活虚拟环境在 powershell 中引发错误

我正在使用 Windows PowerShell。但是,我不知道为什么,当我尝试激活 python 虚拟环境时,出现此错误:

venv\Scripts\activate : File C:\Users\Dell\Desktop\flask\microblog\venv\Scripts\Activate.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
+ venv\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)

这是我运行的命令:

venv\Scripts\activate
Run Code Online (Sandbox Code Playgroud)

这是第一次发生。问题是什么?

powershell

3
推荐指数
1
解决办法
4422
查看次数