【问题标题】:Angular2 Installing dialog-polyfill for IE11 failsAngular2 为 IE11 安装 dialog-polyfill 失败
【发布时间】:2016-10-07 10:32:05
【问题描述】:

我正在尝试让对话框与 IE11 一起使用,但发现我必须安装一个 polyfill。我尝试通过 npm 安装它并遇到多个错误,我不知道如何修复它们。

错误

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "dialog-polyfill"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package typescript@1.8.10 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/compiler-cli@0.5.0 wants typescript@^1.9.0-dev
npm ERR! peerinvalid Peer tsickle@0.1.6 wants typescript@^1.8.0 || ^1.9.0-dev
npm ERR! peerinvalid Peer @angular/tsc-wrapped@0.2.2 wants typescript@^1.9.0-dev`

有什么解决办法吗?

【问题讨论】:

    标签: node.js angular npm internet-explorer-11 polyfills


    【解决方案1】:

    尝试本地安装;从包含package.json的目录运行它:

    npm install --save dialog-polyfill
    

    如果您仍然遇到问题:请尝试以下步骤:

    【讨论】:

    • 抱歉,回答晚了,但这与没有--save 的命令有何不同?
    • @moessi774 --save 会导致安装的包出现在package.jsondependencies部分
    • 如果我在没有--save 的情况下这样做,它只是将资源下载到 node-modules 文件夹,对吧?
    【解决方案2】:

    您需要将 npm 升级到 3 或更高版本:

    npm install -g npm@latest.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-01
      • 2020-03-23
      • 2019-03-14
      • 2017-08-21
      • 1970-01-01
      • 2017-01-07
      • 1970-01-01
      • 2019-11-25
      相关资源
      最近更新 更多