tsc : 无法加载文件 D:\wechat_Devtools\wechatWork\work1\my-qingqi-weixin\node_modules\.bin\tsc.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?Lin kID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符: 1 + tsc --init + ~~~ + CategoryInfo : SecurityError: (:) [],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess PS D:\wechat_Devtools\wechatWork\work1\my-qingqi-weixin> npm install -g typescript D:\nodejs\node_global\tsc -> D:\nodejs\node_global\node_modules\typescript\bin\tsc D:\nodejs\node_global\tsserver -> D:\nodejs\node_global\node_modules\typescript\bin\tsserver npm WARN notsup Unsupported engine for typescript@5.0.4: wanted: {"node":">=12.20"} (current: {"node":"12.18.4","npm":"6.14.6"}) npm WARN notsup Not compatible with your version of node/npm: typescript@5.0.4
时间: 2023-06-07 13:11:17 浏览: 104
根据你的提问,我猜测你可能遇到了关于在 Windows 系统上运行脚本的权限问题。你尝试安装全局的 typescript,但是遇到了一个警告,提示当前的 Node 版本与 typescript 要求的版本不兼容。我建议你先检查一下你的 Node 版本是否符合要求,如果不符合,可以尝试升级 Node 版本或者安装符合要求的 typescript 版本。至于无法加载文件的问题,你可以参考链接中的 about_Execution_Policies,了解一下如何修改脚本执行权限。希望这些信息能对你有所帮助!
相关问题
tsc : 无法加载文件 C:\Users\16632010658_67391\AppData\Roaming\np m\tsc.ps1
这个错误通常是由于在Windows PowerShell中的执行策略限制引起的。默认情况下,Windows系统会限制执行未签名的PowerShell脚本。为了解决这个问题,你可以尝试以下步骤:
1. 打开一个以管理员身份运行的PowerShell窗口。
2. 运行以下命令以解除执行策略限制:
```
Set-ExecutionPolicy RemoteSigned
```
这将允许运行本地脚本和远程签名的脚本。
3. 在PowerShell中再次运行你的命令。
如果你仍然遇到问题,请确保你的tsc.ps1文件存在于指定的路径,并且你具有适当的权限来访问该文件。如果文件确实存在,你可以尝试重新安装TypeScript以确保所有文件都正确地安装和配置。
tsc : 无法加载文件 C:\Users\38241\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本。
错误“tsc : 无法加载文件 C:\Users\38241\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本”是由于系统执行策略(Execution Policy)禁止在系统上运行PowerShell脚本引起的。为了解决这个问题,您可以尝试以下步骤:
步骤一:输入命令“set-ExecutionPolicy RemoteSigned”来更改执行策略为允许远程签名的脚本执行。
步骤二:如果步骤一不起作用,您可以尝试在Vue开发中将template、script和css内容分别抽离出来,以减少一个Vue文件中的代码量过多的问题。通过这种方式,您可以在开发过程中更好地组织和管理您的代码。
请尝试以上步骤来解决您遇到的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [tsc : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本](https://blog.csdn.net/qq_35109140/article/details/130763195)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [tsc-loader:用于Vue文件的Webpack加载器](https://download.csdn.net/download/weixin_42116604/18182329)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [tsc : 无法加载文件 C:\Users\Liush\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本。](https://blog.csdn.net/qq_45037155/article/details/127072882)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
相关推荐














