coreybutler/nvm-windows · error

error accessing %s: %v

Error message

error accessing %s: %v

What it means

copyDirContents walks the extracted assets tree with filepath.Walk, and this error is the walk callback's entry failure: Walk could not access a path under srcDir (read, lstat, or open failed). Within the upgrade this means the freshly extracted temp tree has an entry the process cannot read — AV interference, a broken zip entry, or the temp dir being pruned mid-walk.

Source

Thrown at src/upgrade/upgrade.go:966

	if err != nil {
		return fmt.Errorf("failed to set file permissions: %v", err)
	}

	return nil
}

// copyDirContents copies all the contents (files and subdirectories) of a source directory to a destination directory.
func copyDirContents(srcDir, dstDir string) error {
	// Ensure destination directory exists
	err := os.MkdirAll(dstDir, 0755)
	if err != nil {
		return fmt.Errorf("failed to create destination directory %s: %v", dstDir, err)
	}

	// Walk through the source directory recursively
	err = filepath.Walk(srcDir, func(srcPath string, info os.FileInfo, err error) error {
		if err != nil {
			return fmt.Errorf("error accessing %s: %v", srcPath, err)
		}

		// Construct the corresponding path in the destination directory
		relPath, err := filepath.Rel(srcDir, srcPath)
		if err != nil {
			return fmt.Errorf("failed to get relative path for %s: %v", srcPath, err)
		}

		dstPath := filepath.Join(dstDir, relPath)

		// If it's a directory, ensure it's created in the destination
		if info.IsDir() {
			return os.MkdirAll(dstPath, info.Mode())
		}

		// If it's a file, copy it
		return copyFile(srcPath, dstPath)
	})

View on GitHub (pinned to 5b18223ca1)

Solutions

  1. Exclude the nvm temp directories and NVM_HOME from antivirus scanning, then retry.
  2. Stop temp-cleaning utilities during the upgrade window.
  3. If it recurs, the downloaded zip may be corrupt — retry the whole upgrade to re-download and re-verify via checksum.
  4. Manually inspect the nvm-upgrade-* temp dir for unreadable/oddly named entries to identify the interfering agent.
Defensive patterns

Strategy: retry

Try / catch

Report srcPath in the error (already included); retry the full upgrade once — walk-access failures from AV locks are usually transient. If persistent, inspect the temp tree for the named path to identify the interfering process.

Prevention

When it happens

Trigger: Antivirus locking or deleting extracted binaries while the walk reaches them; unzip produced entries with invalid names (zip-slip remnants, NUL bytes); concurrent temp cleanup removing files mid-walk; permissions on extracted files (written with ModePerm but ACL-restricted by policy).

Common situations: Real-time AV scanning extracted node.exe/nvm.exe; 'free up temp space' tools running during upgrade; corrupted download producing a partially valid zip.

Related errors


AI-assisted analysis of coreybutler/nvm-windows@5b18223ca1 (2026-08-15). Data as JSON: /api/errors/250b277a30bd83a7. Report an issue: GitHub.