【问题标题】:issue upgrading to new angular/cli升级到新 angular/cli 的问题
【发布时间】:2017-07-20 03:05:37
【问题描述】:

我尝试按照此处的说明从 Angular-cli beta.28 升级:https://github.com/angular/angular-cli/wiki/stories-rc.0-update 到最新的 angular/cli,因为存在 href 覆盖错误...

现在,当我运行 ng --version(查看我使用的版本)时,我收到以下错误...我该如何解决这个问题?如果这是预期的行为,我现在应该如何确定我的版本?该应用程序似乎运行良好,并且覆盖错误已修复...

npm --version 4.3.0 PS C:\Users\tpfield\git\ode\ode-client> ng --version ng : 术语“ng”未被识别为 cmdlet、函数、脚本的名称 文件或可运行的程序。检查名称的拼写,或者如果 路径已包含,请验证路径是否正确,然后重试。在 行:1 字符:1 + ng--版本 + ~~ + CategoryInfo : ObjectNotFound: (ng:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

【问题讨论】:

  • 安装/更新运行是否没有出现大量错误?您是以管理员身份还是 root 身份运行安装/更新?
  • 应用程序似乎工作正常,href 覆盖错误已修复...我没有以 root 身份运行,让我试试...我确实收到了这些警告:+-- UNMET依赖 @angular/compiler@^2.3.1 +-- @angular/compiler-cli@2.4.8 | +-- 极简主义@1.2.0 | +-- 反射元数据@0.1.10 | -- UNMET PEER DEPENDENCY typescript@^2.0.2 -- 未满足的依赖 @angular/core@^2.3.1
  • 那么,除了ng --version,一切正常吗?这是不寻常的。 ng serve 没问题?绝对尝试root。祝你好运!
  • 嗯,好的,我重新开始,它工作了......我在想问题是我没有用管理员安装,或者 node_modules 目录没有完全删除......不是当然...感谢您的宝贵时间...
  • 是的,以 root 身份运行它是关键。这在过去一直困扰着我。很高兴你成功了。

标签: angular angular2-cli


【解决方案1】:

我再次执行了这些步骤,这次以管理员身份打开了 cmd,一切正常...不知道是什么问题...

也有可能我第一次运行时没有停止服务器

【讨论】:

    【解决方案2】:

    npm start worked

    PS I:\devlab\nipashe-web> ng --version ng :术语“ng”不被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者路径是否 包括,验证路径是否正确,然后重试。 在行:1 字符:1 + ng--版本 + ~~ + CategoryInfo : ObjectNotFound: (ng:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

    PS I:\devlab\nipashe-web> npm start

    nipashe-web@0.0.0 启动 I:\devlab\nipashe-web 服务

    ** NG Live Development Server 正在http://localhost:4200 上运行。 ** 哈希:9e9c74625fca651c9d2e 时间:51954ms 块 {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 153 kB {5} [初始] [渲染] 块 {1} main.bundle.js, main.bundle.js.map (main) 47 kB {4} [initial] [rendered] 块 {2}styles.bundle.js,styles.bundle.js.map (styles) 770 kB {5} [initial] [rendered] 块 {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 387 kB {5} [初始] [渲染] 块 {4} vendor.bundle.js,vendor.bundle.js.map(供应商)3.48 MB [初始] [渲染] 块 {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered] webpack: 编译成功

    【讨论】:

      猜你喜欢
      • 2019-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-16
      • 2017-10-11
      • 1970-01-01
      • 1970-01-01
      • 2017-04-01
      相关资源
      最近更新 更多