Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

node.js - Cannot find module @angularcliin g

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.

Here, the error :

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

   Error: Cannot find module 'C:Program 
   FilesGit
ode_modules@angularcliin
g'
    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

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Problem:

Error: Cannot find module '..AppDataRoaming pm ode_modulesangular-cliin g' angularJs

Solution:

  1. uninstall angular cli if you have already installed it

    npm uninstall -g @angular/cli
    
  2. Delete the C:UsersSatishAppDataRoaming pm ode_modules@angular folder if it still exists after the uninstall

  3. reinstall angular-cli globally

    npm install -g @angular/cli
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...