Skip to content

correct typos in README #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Why is it needed

Node.js ESM (ES modules) doesn't support the `NODE_PATH` environment variable, unlike CommonJS modules. This creates [issues](https://github.com/pnpm/pnpm/issues/9618) when using pnpm with a [global virtual store](https://pnpm.io/settings#enableglobalvirtualstore). Many packages are importing other packages that are not actually in their dependnecies. To make these package work with pnpm, pnpm creates a directory with semi-hoisted packages at `node_modules/.pnpm/node_modules`. However, when a global virtual store is used, the dependnecies are symlinked from a different directory outside of the project's directory, so dependnecies from this hoisted `node_modules` are not used by Node.js during resolution. To solve this, pnpm adds this hoisted `node_modules` to `NODE_PATH`. This tells Node.js to search the hoisted `node_modules` for dependnecies. This works fine for dependnecies using the CommonJS module system. However, ESM stopped reading the `NODE_PATH` environment variable. That is why this config dependnecy was created. This config dependency registers an ES module loader that will look up dependencies in `NODE_PATH`.
Node.js ESM (ES modules) doesn't support the `NODE_PATH` environment variable, unlike CommonJS modules. This creates [issues](https://github.com/pnpm/pnpm/issues/9618) when using pnpm with a [global virtual store](https://pnpm.io/settings#enableglobalvirtualstore). Many packages are importing other packages that are not actually in their dependencies. To make these package work with pnpm, pnpm creates a directory with semi-hoisted packages at `node_modules/.pnpm/node_modules`. However, when a global virtual store is used, the dependencies are symlinked from a different directory outside of the project's directory, so dependencies from this hoisted `node_modules` are not used by Node.js during resolution. To solve this, pnpm adds this hoisted `node_modules` to `NODE_PATH`. This tells Node.js to search the hoisted `node_modules` for dependencies. This works fine for dependencies using the CommonJS module system. However, ESM stopped reading the `NODE_PATH` environment variable. That is why this config dependency was created. This config dependency registers an ES module loader that will look up dependencies in `NODE_PATH`.

## Installation

Expand Down