lando / lando

A development tool for all your projects that is fast, easy, powerful and liberating
https://lando.dev
GNU General Public License v3.0
4.01k stars 544 forks source link

"Lando cannot write to /usr/local/bin" when running `lando update` #3671

Closed ccharlton closed 3 months ago

ccharlton commented 3 months ago

After running lando setup (those bits are good), running lando update presented the following error. (Just installed Lando v3.21.0-beta.1)

But here's a funny note, when I run lando version it returns "v3.21.0-beta.3"?

PACKAGE              STATUS             COMMENT
@lando/cli           ⚠ Update available https://github.com/lando/cli/releases/tag/v3.21.0-beta.2

  lando [STARTED] Updating @lando/cli to v3.21.0-beta.2  +7544ms
  lando [FAILED] Lando cannot write to /usr/local/bin!  +1ms
  lando {}  +0ms
  lando ERROR Error: An update error occured! Rerun with lando update --debug for more info.
    at Object.run (/Users/myuser/.lando/plugins/@lando/core/tasks/update.js:163:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
From previous event:
    at process.processImmediate (node:internal/timers:476:21)
From previous event:
    at Object.handler (/snapshot/cli/lib/cli.js)
    at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
    at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
    at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
    at Cli.init (/snapshot/cli/lib/cli.js)
    at Cli.run (/snapshot/cli/lib/cli.js)
    at /snapshot/cli/bin/lando.js
From previous event:
    at Object.<anonymous> (/snapshot/cli/bin/lando.js)
    at Module._compile (pkg/prelude/bootstrap.js:1930:22)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1983:12)
    at node:internal/main/run_main_module:23:47  +4ms
maskedjellybean commented 3 months ago

I'm experiencing this too.

jeyram commented 3 months ago

Currently you could change the permissions of that file and run lando update again successfully. In my case, the error was in /usr/share/lando/bin.

sudo chmod 777 /usr/share/lando/bin

Screenshot from 2024-02-21 12-56-28

reynoldsalec commented 3 months ago

On Mac I needed to run the following:

sudo chmod a+w /usr/local/bin && sudo chmod a+w /usr/local/bin/lando && lando update

I'll let @pirog follow-up here, I know he's working on a short-term solution for this, and we'll need to put more work into a longer-term solution that's durable.

reynoldsalec commented 3 months ago

This is a duplicate of https://github.com/lando/core/issues/109; going to close this out in favor of that issue, since ultimately this will be a lando/core fix.