【问题标题】:Cannot destructure property 'name' of 'node' as it is null无法解构“节点”的属性“名称”,因为它为空
【发布时间】:2021-04-19 18:50:41
【问题描述】:

当我想安装 aurelia 项目的依赖时,得到这个错误:

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/ehsanghaffarii/.nvm/versions/node/v15.5.1/bin/node /Users/ehsanghaffarii/.nvm/versions/node/v15.5.1/lib/node_modules/npm/bin/npm-cli.js install --cache=/Users/ehsanghaffarii/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm ERR! code ERESOLVE
npm ERR! npm ERR! Cannot destructure property 'name' of 'node' as it is null.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/ehsanghaffarii/.npm/_cacache/_logs/2021-01-14T17_17_22_767Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ehsanghaffarii/.npm/_logs/2021-01-14T17_19_13_263Z-debug.log

如何解决这个问题?

节点 v15.5.1

npm v7.3.0

【问题讨论】:

    标签: node.js npm aurelia


    【解决方案1】:

    在我和this GitHub thread 看来,您正在尝试安装需要提升权限的全局依赖项和/或 npm 包版本存在错误。确保您有足够的权限将npm 降级到最早的版本。

    如果解决了您的问题,请告诉我。

    【讨论】:

    • 感谢您的指导
    • 对我来说唯一有效的解决方案是回到 npm v6 npm i -g npm@6
    • 我在删除包锁并手动更改节点依赖项时遇到了同样的错误。在 npm install 更改之前,我必须手动删除我的 node_modules。
    • 你可以简单地运行 yarn remove <dependencyName> 而不是手动编辑 package.json
    猜你喜欢
    • 1970-01-01
    • 2022-06-20
    • 2022-07-21
    • 2020-09-08
    • 2022-07-27
    • 2021-07-11
    • 1970-01-01
    • 1970-01-01
    • 2022-06-17
    相关资源
    最近更新 更多