简体   繁体   English

ng:在节点v6.9.1中找不到命令

[英]ng:command not found in node v6.9.1

I am trying to execute an ng command in angular-cli project in my windows 10 PC. 我正在Windows 10 PC的angular-cli项目中尝试执行ng命令。 node v6.9.1 节点v6.9.1

  • Globally installed the angular-cli. 全局安装angular-cli。
  • Tried a fresh npm install. 尝试重新安装npm。
  • Tried adding the path 尝试添加路径
    C:\\Users\\MohamadS\\AppData\\Roaming\\npm\\node_modules\\angular-cli\\bin in uservariables in the path variable. C:\\ Users \\ MohamadS \\ AppData \\ Roaming \\ npm \\ node_modules \\ angular-cli \\ bin在path变量中的uservariables中。

Still it says as in the picture. 仍然如图片所示。

在此处输入图片说明

Need help with the issue. 在此问题上需要帮助。

PS- can't use any of the ng commands.( ng gc /componentName/, ng build) PS-不能使用任何ng命令。(ng gc / componentName /,ng build)

Edited - 编辑-

  • Tried the same angular-cli version in the project folder for the global installation as well. 也尝试在项目文件夹中使用相同的angular-cli版本进行全局安装。

检查是否将npm path添加到系统变量路径中,我安装了npm v4.0.2,我只是简单地做了一个npm install npm @ latest -g并再次安装了angular-cli -g现在它可以工作了。

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

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