INNER CODE UNIT · JavaScript

nvmModules

tunnckoCore/opensource · @packages/all-module-paths/src/index.js:41

  const nvmModules = globalPaths[globalPaths.length - 1];

  // So we dirname two times and then join "pnpm-global/1/node_modules"
  const nvmCurrent = path.dirname(path.dirname(nvmModules));

  // Intentionally getting the NVM_DIR that way,
  // Take care! Might not be cross-platform and
  // probably better way is to be reading the env.
  const nvmDir = path.dirname(path.dirname(path.dirname(nvmCurrent)));

  // Another note is that this node_modules directory don't have `.bin` dir
  // inside of it, similar to the NVM's `vX.X.X/lib/node_modules` one.
  // PNPM uses the default Npm/NVM global bin directory and
  // as far as I know, it cannot be changed.
  // Only the pnpm-store path can be changed.
  const pnpmGlobal = pnpmStoreVersions.find((pnpmGlobalStore) =>
    fs.existsSync(pnpmGlobalStore),
  );

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…