Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/380.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 错误:"@anuglar/compiler cli“;软件包安装不正确_Javascript_Angular_Angular Cli - Fatal编程技术网

Javascript 错误:"@anuglar/compiler cli“;软件包安装不正确

Javascript 错误:"@anuglar/compiler cli“;软件包安装不正确,javascript,angular,angular-cli,Javascript,Angular,Angular Cli,刚接触Angular并接管另一个开发人员启动的项目。我已经安装了Angular并执行了npm安装,但我一直发现“@anuglar/compiler cli”软件包未正确安装。 以下是我迄今为止所做的尝试: (a) npm安装-g类型脚本,然后(b)npm安装-在“ng serve”上没有运气 (a) npm卸载--保存开发人员angular cli(b)npm安装--保存开发人员@angular/cli@latest; - “ng发球”没有运气 终端错误: Error: The "@angula

刚接触Angular并接管另一个开发人员启动的项目。我已经安装了Angular并执行了npm安装,但我一直发现“@anuglar/compiler cli”软件包未正确安装。 以下是我迄今为止所做的尝试:

  • (a) npm安装-g类型脚本,然后(b)npm安装-在“ng serve”上没有运气
  • (a) npm卸载--保存开发人员angular cli(b)npm安装--保存开发人员@angular/cli@latest; - “ng发球”没有运气
  • 终端错误:

    Error: The "@angular/compiler-cli" package was not properly installed.
        at Object.<anonymous> (/Users/Jack/Documents/Github/t-dashboard/node_modules/@ngtools/webpack/src/index.js:14:11)
        at Module._compile (module.js:573:32)
        at Object.Module._extensions..js (module.js:582:10)
        at Module.load (module.js:490:32)
        at tryModuleLoad (module.js:449:12)
        at Function.Module._load (module.js:441:3)
        at Module.require (module.js:500:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/Users/Jack/Documents/Github/t-dashboard/node_modules/@angular/cli/tasks/eject.js:10:19)
        at Module._compile (module.js:573:32)
        at Object.Module._extensions..js (module.js:582:10)
        at Module.load (module.js:490:32)
        at tryModuleLoad (module.js:449:12)
        at Function.Module._load (module.js:441:3)
        at Module.require (module.js:500:17)
        at require (internal/module.js:20:19)
    
    更新1


    Thx的答复,但仍遇到相同的问题。 以下是我使用的命令:

  • npm i-S@angular/compiler cli
    ->在package.json中添加了
    “依赖项”:{..,“@angular/compiler cli”:“^4.2.3”,…}
  • npmi-D@angular/cli
    ->其中添加了
    “devdependences”:{…,“@angular/cli”:“^1.1.2”,…}
  • npm安装->仍然收到相同的错误-“未正确安装“@angular/compiler cli”包。”
  • 我想我会尝试将complier cli安装到devDependency<代码>npm i-S@angular/compiler cli->,其中添加了
    “devdependences”:{…,“@angular/compiler cli”:“^1.1.2”,…}
    ,然后安装npm
  • 更新2

    npm安装
    上,我在执行过程中看到一些警告。你知道这个警告是怎么回事吗?
    npm WARN@angular/compiler-cli@4.2.3需要@angular的对等方/compiler@4.2.3但没有安装。
    npm警告@角度/编译器-cli@4.2.3需要@angular的对等方/core@4.2.3但没有安装。
    npm警告@角度/core@2.2.3需要一个同龄人rxjs@5.0.0-beta.12,但没有安装。
    npm警告@角度/core@2.2.3需要zone.js@^0.6.21的对等机,但未安装任何对等机。
    npm警告@角度/http@2.2.3需要一个同龄人rxjs@5.0.0-beta.12,但没有安装。
    npm警告@角度/router@3.2.3需要一个同龄人rxjs@5.0.0-beta.12,但没有安装。
    npm警告@ng引导/ng-bootstrap@1.0.0-alpha.26需要@angular/core@^4.0.3的对等机,但未安装任何对等机。
    npm警告@ng引导/ng-bootstrap@1.0.0-alpha.26需要@angular/common@^4.0.3的对等机,但未安装任何对等机。
    npm警告@ng引导/ng-bootstrap@1.0.0-alpha.26需要@angular/forms@^4.0.3的对等机,但未安装任何对等机。
    npm警告角度2-ladda@1.2.1需要@angular/core@^4.0.0的对等机,但未安装任何对等机。
    npm警告角度2-toaster@1.0.2需要一个同龄人rxjs@5.0.0-beta.12,但没有安装。
    npm警告codelyzer@1.0.0-beta.4需要tslint@^3.9.0的对等机,但未安装任何对等机。
    npm警告ng2-bootstrap@1.6.3需要@angular/common@^2.3.1| |>=4.0.0的对等方,但未安装任何对等方。
    npm警告ng2-bootstrap@1.6.3需要@angular/compiler@^2.3.1| |>=4.0.0的对等方,但未安装任何对等方。
    npm警告ng2-bootstrap@1.6.3需要@angular/core@^2.3.1| |>=4.0.0的对等机,但未安装任何对等机。
    npm警告ng2-bootstrap@1.6.3需要@angular/forms@^2.3.1| |>=4.0.0的对等机,但未安装任何对等机。
    npm警告ng2-charts@1.6.0需要@angular/common@^2.3.0| |>=4.0.0的对等方,但未安装任何对等方。
    npm警告ng2-charts@1.6.0需要@angular/core@^2.3.0| |>=4.0.0的对等机,但未安装任何对等机。
    npm警告ng2-select@1.2.0需要@angular/common@^2.3.0的对等机,但未安装任何对等机。
    npm警告ng2-select@1.2.0需要@angular/core@^2.3.0的对等机,但未安装任何对等机。
    


    还是一样的错误。还有其他建议吗?提前感谢。

    您缺少编译器cli软件包,只需重新安装即可

    npm i-S@angular/compiler cli

    您的
    package.json
    在开发人员依赖项中似乎也缺少angular cli,您也应该这样做


    npm i-D@angular/cli
    您缺少编译器cli包,只需重新安装它

    npm i-S@angular/compiler cli

    您的
    package.json
    在开发人员依赖项中似乎也缺少angular cli,您也应该这样做


    npm i-D@angular/cli
    dependencies
    数组中添加以下依赖项

        "@angular/cli": "1.0.0",
    

    然后重新运行npm安装ng服务

    依赖项
    数组中添加以下依赖项

        "@angular/cli": "1.0.0",
    

    重新运行npm安装和ng serve软件包的数据不足:

    npm i -g npm-check-updates
    npm-check-updates -u
    npm install
    
    () ... 然后

    npm install npm -g
    
    ()


    谢谢大家的帮助

    包的数据不足:

    npm i -g npm-check-updates
    npm-check-updates -u
    npm install
    
    () ... 然后

    npm install npm -g
    
    ()


    谢谢大家的帮助

    我对Angular、node.js和npm比较陌生,所以我不是说这是一个好的解决方案,但我遇到了一个非常类似的问题,有着非常相似的错误,我通过以下方式解决了这个问题(经过数小时的实验)

  • 我删除了
    node\u模块的内容
  • 运行失败的npm安装
  • 运行
    npm-outleted
    ,它将所有依赖项显示为
    MISSING
  • 已安装最新的
    rxjs
    (从5.4.0升级)
  • 手动安装与版本(4.1.3)匹配的所有
    @angular
    开发依赖项
  • 按以下顺序安装了其余的开发依赖项:
    zone.js
    core js
    webpack
    bootstrap
    以及匹配的版本(看起来顺序很重要)
  • 运行
    npm-outleted
    ,其中显示所有已安装的软件包
  • 运行失败的
    ng build
  • 运行
    npmr@angular/compiler cli-D
    将其从开发人员依赖项中删除。不得不做两次,因为第一次失败了,但似乎(那次失败的时间)在
    node\u模块中增加了很多依赖项
  • 运行
    npmi@angular/compiler-cli@4.1.3-D
    将其添加到我的开发依赖项
  • 成功运行
    ng build

  • 我对Angular、node.js和npm比较陌生,所以我不是说这是一个好的解决方案,但我有一个非常相似的解决方案