[angular2]解决安装 angular-cli 报错:Cannot find module 'github-url-from-git'

 

1.运行:sudo rm -rf /usr/local/lib/node_modules/npm

2.重新安装最新版本的node,最新版本的node已经集成了npm,所以无需另外安装。

3.运行:sudo npm install -g cnpm  安装cnpm

4.在项目目录下运行:sudo cnpm i  angular-cli 安装angular-cli

5.运行:ng -version 验证是否安装成功,如下图:

 

 

 

 

Cannot find module 'github-url-from-git' 问题详细介绍 

 

EACCES: permission denied, symlink '../lib/node_modules/angular-cli/bin/ng' -> '/usr/local/bin/ng' 解决方案

posted @ 2017-03-05 16:26  Mrdo  阅读(2897)  评论(0编辑  收藏  举报