简体   繁体   English

在节点版本为 18.12.1 的 Windows 11 上安装 Angular CLI 时出现问题

[英]Issue while installing Angular CLI on windows 11 with node version 18.12.1

I was trying to install angular cli and i had these two warning i'm afraid that will bother me later i don't know how to fix it help me please.....我正在尝试安装 angular cli,我收到了这两个警告,我担心以后会打扰我,我不知道如何修复它,请帮助我......

C:\Users\ASUS>npm install -g @angular/cli
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead

changed 231 packages, and audited 232 packages in 5s

26 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

After I tried to see the version of angular if it is installed.在我尝试查看 angular 的版本(如果已安装)之后。 The cmd displayed this error. cmd 显示此错误。

C:\Users\ASUS>ng --version
Error: You need to specify a command before moving on. Use '--help' to view the available commands.

Try the command ng v and check if it ask any question about google and say N as no.尝试命令ng v并检查它是否询问有关 google 的任何问题并将 N 选为否。 If it shows angular versions then it means angular/cli is installed如果它显示角度版本,则表示安装了angular/cli

I don't have a specific solution but i have install it with Yarn我没有具体的解决方案,但我已经用 Yarn 安装了它

1.install Yarn 1.安装纱线
https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable in my case i choosed msi download because it failled with npm https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable在我的例子中,我选择了 msi 下载,因为它因 npm 而失败

  1. With Yarn installed Angular / cli安装 Yarn Angular / cli
    yarn add @angular/cli纱线添加@angular/cli

  2. in environment variable I add the path this ng root INSTALLATION_PATH\node_modules.bin在环境变量中我添加路径这个 ng root INSTALLATION_PATH\node_modules.bin
    and now i have it globall.现在我在全球范围内拥有它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM