【问题标题】:unable to install angular cli npm -ERR! code Z_BUF_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end of file无法安装 Angular cli npm -ERR!代码 Z_BUF_ERROR npm ERR! errno -5 npm 错误! zlib:文件意外结束
【发布时间】:2019-05-10 10:57:15
【问题描述】:

C:\Users\darsh>npm -v
6.4.1

C:\Users\darsh>节点-v
v10.14.1

C:\Users\darsh>npm install -g @angular/cli
npm 错误!代码 Z_BUF_ERROR
npm 错误!错误号 -5
npm 错误! zlib:文件意外结束

npm 错误!可以在以下位置找到此运行的完整日志: npm 错误! C:\Users\darsh\AppData\Roaming\npm-cache_logs\2018-12-09T07_55_28_446Z-debug.log

在安装 Angular cli 时遇到这些错误

【问题讨论】:

标签: angular npm


【解决方案1】:

这对我有用……你可以试试。

npm cache clean --force

【讨论】:

    【解决方案2】:

    删除node_modules目录:

    rm node_modules
    

    删除package-lock.json,然后重新安装:

    npm install
    

    【讨论】:

      【解决方案3】:

      尝试使用以下命令清理缓存:npm cache clean

      如果您无法通过以下方式强制清理:npm cache clean --force

      对我有用

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-08-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-11-20
        • 2018-10-29
        • 2021-07-27
        • 1970-01-01
        相关资源
        最近更新 更多