node.js - ubuntu ng 命令不起作用

标签 node.js ubuntu angular-cli

我正在尝试让 angular-cli 在 ubuntu 中工作。 所以我安装了它,但遇到了问题。

目前我在 root 中工作。

运行npm install -g angular-cli并输入ng help或任何ng命令后,我在控制台中得到以下内容:(尝试了ngserve)

enter image description here

或者使用帮助命令:enter image description here

那是什么?我该如何解决这个问题?我怎样才能退出它?

为什么它没有列出应有的 ng 帮助或任何命令?

最佳答案

这个问题也发布在 git 上 https://github.com/angular/angular-cli/issues/3759

所以解决方案是 - 看起来您的系统上安装了 ng-common 软件包,它还提供了 ng 可执行文件。 它似乎是 Nihongo Micro Gnu Emacs 编辑器。如果您不使用它或不知道它,则可以安全地使用 sudo apt remove ng-common 卸载它,然后删除 Node 缓存。 再次尝试重新安装 Angular/cli。 如果即使在此之后它也不起作用,那么请在 .bashrc 或 .profile 中提供路径 别名='path/to/node_modules/angular-cli/bin/ng'

使用 npm run 直接运行每个 cli 命令,例如npm run ng new app1

关于node.js - ubuntu ng 命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43781551/

相关文章:

linux - Ubuntu 桌面在 Azure xrdp 上不可见

node.js - Angular 2在不重新启动的情况下不显示图像

Angular 8 ng-build 使用 cordova 抛出 MIME 错误

node.js - node-inspector/v8-profiler 未开始分析或创建 v8 日志文件

ubuntu - 无法在 Samba Share 中打开 VScode

node.js - 无法通过express.js和路径在views目录中查找 View

linux - 如何将挂载的文件夹链接到 Laravel 项目?

css - 有什么方法可以告诉 angular-cli(对于 angular 2)生成缩小版的 css 吗?

node.js - 使用 Node 10.x 而不是 14.x 的 Azure Web App

node.js - 当 ClientEmitter 出现错误时运行函数