diff --git a/packages/cli/lib/nydusd/fuse_mode.js b/packages/cli/lib/nydusd/fuse_mode.js index e35af68..06e656c 100644 --- a/packages/cli/lib/nydusd/fuse_mode.js +++ b/packages/cli/lib/nydusd/fuse_mode.js @@ -212,7 +212,7 @@ async function endNydusFs(cwd, pkg, force = true, daemon) { ); if (os.type() === 'Darwin') { await wrapRetry({ - cmd: () => execa.command(wrapSudo(`${umountCmd} ${nodeModulesDir}`)), + cmd: () => execa.command(`${umountCmd} ${nodeModulesDir}`), title: 'umount node_modules', }); await fs.rm(nodeModulesDir, { recursive: true, force: true }); diff --git a/packages/deamon/src/config.rs b/packages/deamon/src/config.rs index 1663241..60513c0 100644 --- a/packages/deamon/src/config.rs +++ b/packages/deamon/src/config.rs @@ -122,10 +122,13 @@ impl NydusdApiMount { error!("Error executing umount: {:?}", e); } + create_dir_if_not_exists(self.node_modules_dir.clone())?; + let str = format!( r#"mount -o port=52100,mountport=52100,vers=4,namedattr,rwsize=262144,nobrowse -t nfs fuse-t:/rafs-/{} {}"#, self.mountpoint, self.node_modules_dir ); + match start_command(&str) { Ok(output) => { if output.status.success() { @@ -185,6 +188,8 @@ impl NydusdApiMount { let body = String::from_utf8_lossy(&binding).to_string(); if body.contains("object or filesystem already exists") { + #[cfg(target_os = "macos")] + self.link_node_modules()?; return Ok(()); }