代码之家  ›  专栏  ›  技术社区  ›  Rathma

ng发球失败,yarn担任包装经理

  •  2
  • Rathma  · 技术社区  · 7 年前

    yarn 作为包管理器 angular-cli ,当我跑步时 ng new my-app

    Installing packages for tooling via yarn.
    Installed packages for tooling via yarn.
    

    ng-serve 我收到以下错误消息:

    The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'Error: The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'
        at Object.<anonymous> (C:\Users\Hadi\AppData\Local\Yarn\config\global\node_modules\@ngtools\webpack\src\index.js:14:11)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
        at Function.Module._load (module.js:438:3)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (C:\Users\Hadi\AppData\Local\Yarn\config\global\node_modules\@angular\cli\tasks\eject.js:10:19)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
        at Function.Module._load (module.js:438:3)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (C:\Users\Hadi\AppData\Local\Yarn\config\global\node_modules\@angular\cli\models\webpack-configs\styles.js:6:17)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
        at Function.Module._load (module.js:438:3)
    

    我有 angular-clie 版本1.4.4和 版本1.1.0

    1 回复  |  直到 7 年前
        1
  •  4
  •   Chandru    7 年前

    执行以下步骤:

    npm install -g yarn
    ng set --global packageManager=yarn
    

    使用运行项目

    yarn start