larry*wei 2013-12-24 17:49 采纳率: 0%
浏览 637
已采纳

为什么 npm 安装说我有未满足的依赖?

I have a node package. When I run npm install from the package root, it installs a bunch of things, but then prints several error messages that look like this:

npm WARN unmet dependency /Users/seanmackesey/google_drive/code/explore/generator/node_modules/findup-sync/node_modules/glob requires graceful-fs@'~1.2.0' but will load

I must be confused about what exactly npm install does. If it detects a dependency, shouldn't it install it? Under what conditions does it give me error messages like this, and how can I resolve the dependencies?

转载于:https://stackoverflow.com/questions/20764881/why-does-npm-install-say-i-have-unmet-dependencies

  • 写回答

16条回答 默认 最新

  • 零零乙 2013-12-24 18:37
    关注

    I believe it is because the dependency resolution is a bit broken, see https://github.com/isaacs/npm/issues/1341#issuecomment-20634338

    Following are the possible solution :

    1. Manually need to install the top-level modules, containing unmet dependencies: npm install findup-sync@0.1.2

    2. Re-structure your package.json. Place all the high-level modules (serves as a dependency for others modules) at the bottom.

    3. Re-run the 'npm install' command.

    The problem could be caused by npm's failure to download all the package due to timed-out or something else.

    Note: You can also install the failed packages manually as well using npm install findup-sync@0.1.2.

    Before running 'npm install', performing the following steps may help:

    • remove node_modules using rm -rf node_modules/
    • run npm cache clean

    Why 'removing node_modules' sometimes is necessary? When a nested module fails to install during npm install, subsequent npm install won't detect those missing nested dependencies.

    If that's the case, sometimes it's sufficient to remove the top-level dependency of those missing nested modules, and running npm install again. See

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(15条)

报告相同问题?

悬赏问题

  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号