From ca9281825b5fd8e0b8799964b13fffe91327caae Mon Sep 17 00:00:00 2001 From: Nhan Doan Date: Thu, 21 Aug 2025 00:54:22 +0700 Subject: [PATCH] fix: shell command syntax (#1699) ## Problem I followed the instructions and got this error when running an NPM package globally: ``` Path "/Users/me/~/.npm-global/lib/node_modules" does not exist. Please check the NODE_PATH environment variable. ``` In `.npmrc` the prefix was set to: ``` prefix=~/.npm-global ``` `~` is not expanded here so NPM looks for a literal `~/` path instead of the home directory. ## Solution Use the absolute path instead: ``` prefix=/Users/me/.npm-global ``` Run `npm config` without quotes around the path so that `~` is properly expanded. --- ...ces-permissions-errors-when-installing-packages-globally.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/packages-and-modules/getting-packages-from-the-registry/resolving-eacces-permissions-errors-when-installing-packages-globally.mdx b/content/packages-and-modules/getting-packages-from-the-registry/resolving-eacces-permissions-errors-when-installing-packages-globally.mdx index 790f628a2d6..f7b0c9ebe4b 100644 --- a/content/packages-and-modules/getting-packages-from-the-registry/resolving-eacces-permissions-errors-when-installing-packages-globally.mdx +++ b/content/packages-and-modules/getting-packages-from-the-registry/resolving-eacces-permissions-errors-when-installing-packages-globally.mdx @@ -37,7 +37,7 @@ To minimize the chance of permissions errors, you can configure npm to use a dif 3. Configure npm to use the new directory path: ``` - npm config set prefix '~/.npm-global' + npm config set prefix ~/.npm-global ``` 4. In your preferred text editor, open or create a `~/.profile` file and add this line: