# Fix \#4628: npm install to a wrong location \(\#6742\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8e523d812f89ad5bb413c564f26cff3a1f76f387)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8e523d812f89ad5bb413c564f26cff3a1f76f387

Requested commit: 8e523d812f89ad5bb413c564f26cff3a1f76f387

Commit: 8e523d812f89ad5bb413c564f26cff3a1f76f387

Tree: eaf8358f003778080c098de694e13764658a5edd

Author: Julia

Committer: GitHub

## Message

```
Fix #4628: npm install to a wrong location (#6742)

By default `npm install` will walk up the folder tree checking for a
folder that contains either a package.json file, or a node_modules
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands.
This caused npm dependencies for language servers sometimes to be
installed in the wrong folder, described in #4628.
Adding `--prefix ./` to `npm install` forces
node_runtime.npm_install_packages to install packages in provided path
even if node_modules dir exists somewhere up the filesystem tree from
installation path.
```

## Parents

- [1f82a2aca1ef45ce182f5fc5068dee652f7d63e0](https://git.cafe/gitcafe/zed/commit/1f82a2aca1ef45ce182f5fc5068dee652f7d63e0?format=markdown)

- [42e605a766995b7deec8f31ecb71690548f7674d](https://git.cafe/gitcafe/zed/commit/42e605a766995b7deec8f31ecb71690548f7674d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8e523d812f89ad5bb413c564f26cff3a1f76f387?format=markdown)
