Skip to content

Update via npm on MacOS failed #2084

Description

@torstenhoppe

Describe the bug A clear and concise description of what the bug is.
I've been using MW-CLI on my Mac for a while now and installed it via npm. However, the update process didn't work as expected there. So I copied the contents of my terminal so you can follow along with each step. (Note: I've removed some general help text.)

user@Mac ~ % mw 
 ›   Warning: @mittwald/cli update available from 1.17.2 to 1.23.0.
Hand-crafted CLI for the mittwald API

VERSION
  @mittwald/cli/1.17.2 darwin-arm64 node-v24.13.1

USAGE / TOPICS / COMMANDS
...

user@Mac ~ % mw update
@mittwald/cli: Updating CLI... not updatable


user@Mac ~ % sudo mw update
Password:
@mittwald/cli: Updating CLI... not updatable


user@Mac ~ % mw --version
 ›   Warning: @mittwald/cli update available from 1.17.2 to 1.23.0.
@mittwald/cli/1.17.2 darwin-arm64 node-v24.13.1


user@Mac ~ % npm update -g @mittwald/cli
npm error code EACCES
npm error syscall rename
npm error path /usr/local/lib/node_modules/@mittwald/cli
npm error dest /usr/local/lib/node_modules/@mittwald/.cli-WYK5E5NH
npm error errno -13
npm error Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/@mittwald/cli' -> '/usr/local/lib/node_modules/@mittwald/.cli-WYK5E5NH'
npm error     at async Object.rename (node:internal/fs/promises:782:10)
npm error     at async moveFile (/usr/local/lib/node_modules/npm/node_modules/@npmcli/fs/lib/move-file.js:30:5)
npm error     at async Promise.allSettled (index 0)
npm error     at async #reifyPackages (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:309:11)
npm error     at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
npm error     at async Update.exec (/usr/local/lib/node_modules/npm/lib/commands/update.js:64:5)
npm error     at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:208:9)
npm error     at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:67:5) {
npm error   errno: -13,
npm error   code: 'EACCES',
npm error   syscall: 'rename',
npm error   path: '/usr/local/lib/node_modules/@mittwald/cli',
npm error   dest: '/usr/local/lib/node_modules/@mittwald/.cli-WYK5E5NH'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /Users/hms/.npm/_logs/2026-08-24T06_20_41_866Z-debug-0.log
user@Mac ~ % sudo npm update -g @mittwald/cli

added 4 packages, removed 1 package, and changed 10 packages in 1s

119 packages are looking for funding
  run `npm fund` for details
user@Mac ~ % mw --version                    
(node:14589) Warning: SyntaxError
module: @oclif/core@4.11.7
task: findCommand (experimental:deploy)
plugin: @mittwald/cli
root: /usr/local/lib/node_modules/@mittwald/cli
message: The requested module '@mittwald/container-deploy' does not provide an export named 'DEFAULT_IMAGE_NAME'
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
@mittwald/cli/1.23.0 darwin-arm64 node-v24.13.1

To get the latest version anyway, I reinstalled it and received the following output:

user@Mac ~ % npm install -g @mittwald/cli
npm error code EACCES
npm error syscall rename
npm error path /usr/local/lib/node_modules/@mittwald/cli
npm error dest /usr/local/lib/node_modules/@mittwald/.cli-WYK5E5NH
npm error errno -13
npm error Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/@mittwald/cli' -> '/usr/local/lib/node_modules/@mittwald/.cli-WYK5E5NH'
npm error     at async Object.rename (node:internal/fs/promises:782:10)
npm error     at async moveFile (/usr/local/lib/node_modules/npm/node_modules/@npmcli/fs/lib/move-file.js:30:5)
npm error     at async Promise.allSettled (index 0)
npm error     at async #reifyPackages (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:309:11)
npm error     at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
npm error     at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error     at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:208:9)
npm error     at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:67:5) {
npm error   errno: -13,
npm error   code: 'EACCES',
npm error   syscall: 'rename',
npm error   path: '/usr/local/lib/node_modules/@mittwald/cli',
npm error   dest: '/usr/local/lib/node_modules/@mittwald/.cli-WYK5E5NH'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /Users/hms/.npm/_logs/2026-08-24T06_22_23_465Z-debug-0.log
user@Mac ~ % sudo npm install -g @mittwald/cli

added 5 packages, removed 3 packages, and changed 352 packages in 4s

107 packages are looking for funding
  run `npm fund` for details

user@Mac ~ % mw --version                     
@mittwald/cli/1.23.0 darwin-arm64 node-v24.13.1

user@Mac ~ % 

Now that I'm looking at this in detail again, the update didn't work with either the regular user or sudo. A global update didn't work either, but a reinstallation using sudo did. Is this normal, or did I make any mistake in the first few steps?

Environment (please complete the following information):

  • OS: macOS 26.5.2
  • Shell: zsh
  • Terminal: standard Apple 2.15
  • Version: see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions