在 WSL2 中的 Ubuntu-20.04 ,将 Shopify CLI 更新至最新版本
1、执行 shopify version,以查看 Shopify CLI 的当前版本
wangqiang@DESKTOP-QLPK8QM:~$ shopify version Current Shopify CLI version: 3.49.7 💡 Version 3.52.0 available!
2、执行 shopify upgrade,以将 Shopify CLI 更新至最新版本,报错:Error: EACCES: permission denied, rename ‘/usr/lib/node_modules/@shopify/cli’ -> ‘/usr/lib/node_modules/@shopify/.cli-9RdBklQd’ 。如图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、在命令 npm install -g @shopify/cli@latest @shopify/theme@latest 前添加 sudo,以提升权限,不再报错
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、但是查看版本号,仍然无变化。参考:https://www.shuijingwanwq.com/2023/11/29/8249/ 执行:shopify version 时,提示:Version 3.49.7 available!,但是执行:shopify upgrade 成功后,仍然提示:Version 3.49.7 available!。决定暂缓处理。
wangqiang@DESKTOP-QLPK8QM:~$ shopify version Current Shopify CLI version: 3.49.7 💡 Version 3.52.0 available!
近期评论