【问题标题】:npm install -g angular-cli doesnt worknpm install -g angular-cli 不起作用
【发布时间】:2016-11-09 20:08:24
【问题描述】:

更新:

好的,它 seccussfully 安装了“npm install -g angular-cli”,但现在出现新错误:“您不能在 angular-cli 项目中使用新命令。”同时尝试做:“ng new ang2pro”用于制作新项目。

C:\Users\armyTik\Desktop\angular2_projects\1>ng new pro-name
(node:6512) fs: re-evaluating native module sources is not supported. If you are using
 the graceful-fs module, please update it to a more recent version.
You cannot use the new command inside an angular-cli project.

原帖:

昨天运行良好,现在重新安装 nodejs 后出现以下错误:

(cmd以管理员权限打开)

【问题讨论】:

  • 仅在安装angular-cli 包或所有包时才会出现此错误。它清楚地表明您的global 目录路径存在问题。
  • 我做的唯一步骤是创建一个空文件夹并在“npm install -g angular-cli”中运行。
  • 你能尝试安装其他软件包吗?喜欢npm install -g jquery
  • 你也不必去空目录来运行这个命令。你可以在任何地方运行它。它只是在配置的global 路径中安装包。默认为 `C:\AppData\Roaming\npm\node_modules`

标签: node.js angular npm angular2-cli


【解决方案1】:

如果您使用的是 Mac,请不要忘记命令前面的 sudo

【讨论】:

    【解决方案2】:

    确保您的机器上安装了prerequisites

    angular-cli needs Node 4 or above & Typings V1 or greater

    node -v 应该大于 4

    node typings -v 应该大于 1

    否则使用npm install typings -g 安装typings

    【讨论】:

    • 我确实有这一切,但仍然没有我得到同样的错误。
    猜你喜欢
    • 2022-01-12
    • 2018-06-06
    • 2018-07-30
    • 2018-05-08
    • 2017-09-27
    • 1970-01-01
    • 2018-01-01
    • 2021-04-21
    • 1970-01-01
    相关资源
    最近更新 更多