summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/npm/managed/resolvers/local.rs16
-rw-r--r--cli/util/fs.rs4
2 files changed, 14 insertions, 6 deletions
diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs
index 0968be8a7..eddb0dc9b 100644
--- a/cli/npm/managed/resolvers/local.rs
+++ b/cli/npm/managed/resolvers/local.rs
@@ -1035,12 +1035,18 @@ fn junction_or_symlink_dir(
if symlink_err.kind() == std::io::ErrorKind::PermissionDenied =>
{
USE_JUNCTIONS.store(true, std::sync::atomic::Ordering::Relaxed);
- junction::create(old_path, new_path).map_err(Into::into)
+ junction::create(old_path, new_path)
+ .context("Failed creating junction in node_modules folder")
+ }
+ Err(symlink_err) => {
+ log::warn!(
+ "{} Unexpected error symlinking node_modules: {symlink_err}",
+ colors::yellow("Warning")
+ );
+ USE_JUNCTIONS.store(true, std::sync::atomic::Ordering::Relaxed);
+ junction::create(old_path, new_path)
+ .context("Failed creating junction in node_modules folder")
}
- Err(symlink_err) => Err(
- AnyError::from(symlink_err)
- .context("Failed creating symlink in node_modules folder"),
- ),
}
}
diff --git a/cli/util/fs.rs b/cli/util/fs.rs
index 2c34f486a..d36c02242 100644
--- a/cli/util/fs.rs
+++ b/cli/util/fs.rs
@@ -565,7 +565,9 @@ pub fn symlink_dir(oldpath: &Path, newpath: &Path) -> Result<(), Error> {
use std::os::windows::fs::symlink_dir;
symlink_dir(oldpath, newpath).map_err(|err| {
if let Some(code) = err.raw_os_error() {
- if code as u32 == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD {
+ if code as u32 == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD
+ || code as u32 == winapi::shared::winerror::ERROR_INVALID_FUNCTION
+ {
return err_mapper(err, Some(ErrorKind::PermissionDenied));
}
}