Getting some errors when installing (W10 + WSL Ubuntu) #1779

Closed
opened 2026-02-16 17:32:35 -05:00 by yindo · 2 comments
Owner

Originally created by @Decme on GitHub (Sep 20, 2025).

Originally assigned to: @thdxr on GitHub.

I'm on Windows 10, trying to install in WSL (Ubuntu)

I have nodejs installed. I've run the following two commands:
curl -fsSL https://opencode.ai/install | bash
npm i -g opencode-ai@latest

Note: I would prefer NOT to use sudo to install opencode.

Getting the following error:

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2025-09-20T18_13_48_397Z-debug-0.log

Originally created by @Decme on GitHub (Sep 20, 2025). Originally assigned to: @thdxr on GitHub. I'm on Windows 10, trying to install in WSL (Ubuntu) I have nodejs installed. I've run the following two commands: curl -fsSL https://opencode.ai/install | bash npm i -g opencode-ai@latest Note: I would prefer NOT to use sudo to install opencode. Getting the following error: npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules' npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'mkdir', npm ERR! path: '/usr/local/lib/node_modules' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2025-09-20T18_13_48_397Z-debug-0.log
yindo closed this issue 2026-02-16 17:32:35 -05:00
Author
Owner

@Decme commented on GitHub (Sep 20, 2025):

Resolved:

  1. Remove old Node.js and npm (installed via apt)
    sudo apt remove -y nodejs npm

  2. Install NVM (Node Version Manager)
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

  3. Reload shell (source .bashrc for bash)
    source ~/.bashrc

  4. Install the latest LTS version of Node.js (v20+)
    nvm install --lts

  5. Use the LTS version
    nvm use --lts

  6. Set it as default so it loads automatically in new terminals
    nvm alias default lts/*

@Decme commented on GitHub (Sep 20, 2025): Resolved: 1. Remove old Node.js and npm (installed via apt) sudo apt remove -y nodejs npm 2. Install NVM (Node Version Manager) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash 3. Reload shell (source .bashrc for bash) source ~/.bashrc 4. Install the latest LTS version of Node.js (v20+) nvm install --lts 5. Use the LTS version nvm use --lts 6. Set it as default so it loads automatically in new terminals nvm alias default lts/*
Author
Owner

@rekram1-node commented on GitHub (Sep 20, 2025):

Nice! I was just about to provide some guidance sorry it’s been a busy day for me, glad you got this resolved!!

@rekram1-node commented on GitHub (Sep 20, 2025): Nice! I was just about to provide some guidance sorry it’s been a busy day for me, glad you got this resolved!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1779