【问题标题】:ng serve issue Cannot find module '@ngtools/json-schema' on macng服务问题在mac上找不到模块'@ngtools/json-schema'
【发布时间】:2017-12-17 22:16:27
【问题描述】:

在我的 windows 机器上,我可以运行 ng serve,但是当我在 mac 上尝试时,我得到了这个错误:

module.js:544
    throw err;
    ^

Error: Cannot find module '@ngtools/json-schema'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/config/config.js:6:23)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)

我试图 npm install json-schema 但它没有帮助。有什么建议吗?

【问题讨论】:

    标签: angular command-line-interface jsonschema serve


    【解决方案1】:

    尝试删除 node 和 npm 并重新安装。 使用以下版本:

    • 节点 8.0.0
    • npm 5.0.0: $ npm install npm@5.0.0
    • angular-cli 1.0.0: $ npm install -g @angular/cli@1.0.0

    【讨论】:

      猜你喜欢
      • 2018-06-06
      • 2018-06-18
      • 2018-02-01
      • 2019-01-10
      • 1970-01-01
      • 1970-01-01
      • 2018-02-09
      • 1970-01-01
      • 2019-01-04
      相关资源
      最近更新 更多