Skip to content

Commit ca92818

Browse files
authored
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.
1 parent 22797a3 commit ca92818

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/packages-and-modules/getting-packages-from-the-registry/resolving-eacces-permissions-errors-when-installing-packages-globally.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To minimize the chance of permissions errors, you can configure npm to use a dif
3737
3. Configure npm to use the new directory path:
3838

3939
```
40-
npm config set prefix '~/.npm-global'
40+
npm config set prefix ~/.npm-global
4141
```
4242

4343
4. In your preferred text editor, open or create a `~/.profile` file and add this line:

0 commit comments

Comments
 (0)