Skip to content

fix: use sudo for npm installation if needed#91

Closed
Dogacel wants to merge 1 commit into
NVIDIA:mainfrom
Dogacel:main
Closed

fix: use sudo for npm installation if needed#91
Dogacel wants to merge 1 commit into
NVIDIA:mainfrom
Dogacel:main

Conversation

@Dogacel

@Dogacel Dogacel commented Mar 17, 2026

Copy link
Copy Markdown

If user already has an existing node installation, the installation might fail silently due to folder permissions.

npm error Error: EACCES: permission denied, rename '/usr/lib/node_modules/nemoclaw' -> '/usr/lib/node_modules/.nemoclaw-z188BoW2'

-> ls -alh /usr/lib/node_modules
drwxr-xr-x  4 root root 4.0K Mar 16 20:14 .

Also I've faced another similar issue

npm error Error: EACCES: permission denied, symlink '../lib/node_modules/nemoclaw/bin/nemoclaw.js' -> '/usr/bin/nemoclaw'

This modification would spawn npm install with root privilage if needed to fix this warning.

It fixed my issue in my case.

@wscurran wscurran added bug Something fails against expected or documented behavior NemoClaw CLI labels Mar 19, 2026
@cv

cv commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

Hi @Dogacel, thanks for looking into the sudo handling for npm installs — that's a real pain point for folks. Just a heads-up: there's been a lot of activity on this repo since you opened this PR (CI pipelines, new features, etc.), so things have shifted around a bit. Could you rebase this onto the latest main? We'd love to take another look once it's up to date. Thanks!

@MauroDruwel

MauroDruwel commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for working on this! I opened PR #821 with a no-sudo alternative: instead of retrying with elevated privileges, it detects a non-writable npm prefix and redirects it to ~/.npm-global before npm link runs, the same pattern already used in the upstream OpenClaw installer. No sudo required, works in Docker/CI, and is a no-op for anyone already on nvm/fnm/Volta.

@Dogacel

Dogacel commented Mar 24, 2026

Copy link
Copy Markdown
Author

@cv Sorry I was travelling!

I think @MauroDruwel 's approach makes more sense, I was also skeptical about using sudo, but I've created this PR anyway to guide anyone who got stuck on the same issue.

I think we can continue from #821 .

@cv

cv commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Dogacel! I'm closing this for now, and we can continue in #821 then! :)

@cv cv closed this Mar 24, 2026
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression and removed NemoClaw CLI bug Something fails against expected or documented behavior labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants