找不到模块@angular \ cli \ bin \ ng [英] Cannot find module @angular\cli\bin\ng

查看:183
本文介绍了找不到模块@angular \ cli \ bin \ ng的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装anngular-cli时遇到了麻烦,因为它无法识别git bash中的ng命令,但可以在Windows 7的cmd中使用.

I'm getting into trouble with anngular-cli installation because it doesn't recognize the ng command in my git bash but it works in my cmd on Windows 7.

我在网上寻找了一些问题,但是我并没有真正找到解决方案.

I looked for some issues on the web but I didn't really find a solution.

在这里,错误:

   ng -v
   module.js:549
    throw err;
    ^

   Error: Cannot find module 'C:\Program 
   Files\Git\node_modules\@angular\cli\bin\ng'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

此错误发生在我全局安装Node和angular-cli之后第一次使用ng.

This error happened the first time I used ng after installing Node and angular-cli globally.

在Windowsd 10上的笔记本电脑上工作时,我没有收到此错误.

I didn't get this error when I was working on my laptop on Windowsd 10.

谢谢

推荐答案

问题:

错误:找不到模块'.. \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ bin \ ng'angularJs

Error: Cannot find module '..\AppData\Roaming\npm\node_modules\angular-cli\bin\ng' angularJs

解决方案:

  1. 如果已安装,请卸载angular cli

  1. uninstall angular cli if you have already installed it

npm uninstall -g @angular/cli

  • 如果卸载后仍然存在,请删除C:\ Users \ Satish \ AppData \ Roaming \ npm \ node_modules @ angular文件夹

  • Delete the C:\Users\Satish\AppData\Roaming\npm\node_modules@angular folder if it still exists after the uninstall

    全局重新安装angular-cli

    reinstall angular-cli globally

    npm install -g @angular/cli
    

  • 这篇关于找不到模块@angular \ cli \ bin \ ng的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆