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

在不匹配的peerDependencies上强制npm安装失败

  •  0
  • Jacob  · 技术社区  · 5 年前

    npm install 完全 失败 当peerDependency版本不匹配时?我们经常碰到相互依赖的问题 警告

    1 回复  |  直到 5 年前
        1
  •  0
  •   jonrsharpe    5 年前

    你不能(据我所知)在 npm install ,但你呢 可以 呼叫 npm ls 之后-如果有的话 ,包括缺少对等依赖项,它将非零退出。使用标志 --depth 0

    $ npm ls --depth 0
    cyf-eslint@1.0.0 path/to/dir
    ├── @codeyourfuture/eslint-config-standard@2.0.1
    └── UNMET PEER DEPENDENCY eslint@7.5.0
    
    npm ERR! peer dep missing: eslint@^6.0.0, required by @codeyourfuture/eslint-config-standard@2.0.1
    
    $ echo $?
    1