Skip to main content
Version: 9.x

局限性

  1. npm-shrinkwrap.jsonpackage-lock.json 被忽略。与 pnpm 不同,npm 可以多次安装相同的 name@version,并具有不同的依赖集。npm 的锁定文件旨在反映扁平 node_modules 布局,但是,由于 pnpm 默认创建独立布局,因此它无法遵循 npm 的锁定文件格式。不过,如果你希望将锁定文件转换为 pnpm 的格式,请参阅 pnpm import

    ¥npm-shrinkwrap.json and package-lock.json are ignored. Unlike pnpm, npm can install the same name@version multiple times and with different sets of dependencies. npm's lockfile is designed to reflect the flat node_modules layout, however, as pnpm creates an isolated layout by default, it cannot respect npm's lockfile format. See pnpm import if you wish to convert a lockfile to pnpm's format, though.

  2. Binstub(node_modules/.bin 中的文件)始终是 shell 文件,而不是 JS 文件的符号链接。创建 shell 文件是为了帮助可插入 CLI 应用在不寻常的 node_modules 结构中查找其插件。这很少是一个问题,如果你希望该文件是 JS 文件,请直接引用原始文件,如 #736 中所述。

    ¥Binstubs (files in node_modules/.bin) are always shell files, not symlinks to JS files. The shell files are created to help pluggable CLI apps in finding their plugins in the unusual node_modules structure. This is very rarely an issue and if you expect the file to be a JS file, reference the original file directly instead, as described in #736.

有解决这些问题的想法吗?分享它们。

¥Got an idea for workarounds for these issues? Share them.