1. Run shopify version to check the current version of Shopify CLI.
wangqiang@DESKTOP-QLPK8QM:~$ shopify version
Current Shopify CLI version: 3.49.7
💡 Version 3.52.0 available!2. Run shopify upgrade to update Shopify CLI to the latest version. An error occurs: Error: EACCES: permission denied, rename ‘/usr/lib/node_modules/@shopify/cli’ -> ‘/usr/lib/node_modules/@shopify/.cli-9RdBklQd’ . See Figure 1.

wangqiang@DESKTOP-QLPK8QM:~$ shopify upgrade
Upgrading CLI from 3.49.7 to 3.52.0...
Attempting to upgrade via npm install -g @shopify/cli@latest @shopify/theme@latest...
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/@shopify/cli
npm ERR! dest /usr/lib/node_modules/@shopify/.cli-9RdBklQd
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/@shopify/cli' -> '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'
npm ERR! [Error: EACCES: permission denied, rename '/usr/lib/node_modules/@shopify/cli' -> '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/@shopify/cli',
npm ERR! dest: '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'
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/wangqiang/.npm/_logs/2023-12-07T03_09_49_269Z-debug-0.log
Upgrade failed!
── external error ────────────────────────────────────────────────────────────────────────────────────────────────
Error coming from `npm install -g @shopify/cli@latest @shopify/theme@latest`
Command failed with exit code 243: npm install -g @shopify/cli@latest @shopify/theme@latest
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
3. Add sudo before the command npm install -g @shopify/cli@latest @shopify/theme@latest to elevate privileges, and the error no longer occurs.
wangqiang@DESKTOP-QLPK8QM:~$ sudo npm install -g @shopify/cli@latest @shopify/theme@latest
changed 1013 packages in 1m
121 packages are looking for funding
run `npm fund` for details
4. However, checking the version number shows no change. Reference: https://www.shuijingwanwq.com/2023/11/29/8249/ When running: shopify version, it prompts: Version 3.49.7 available!, but after successfully running: shopify upgrade, it still prompts: Version 3.49.7 available!. I decide to hold off on dealing with this for now.
wangqiang@DESKTOP-QLPK8QM:~$ shopify version
Current Shopify CLI version: 3.49.7
💡 Version 3.52.0 available!
