mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 11:29:25 +00:00
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.
This commit is contained in:
commit
8e523d812f
1 changed files with 1 additions and 0 deletions
|
@ -166,6 +166,7 @@ impl NodeRuntime for RealNodeRuntime {
|
|||
|
||||
if let Some(directory) = directory {
|
||||
command.current_dir(directory);
|
||||
command.args(["--prefix".into(), directory.to_path_buf()]);
|
||||
}
|
||||
|
||||
command.output().await.map_err(|e| anyhow!("{e}"))
|
||||
|
|
Loading…
Reference in a new issue