运行npm run dev遇The requested scope is invalid错误求助
Shopify App开发认证错误:invalid_scope问题
问题现象
已登录Shopify账号,执行npm run dev并按任意键触发授权流程后,终端抛出权限范围无效错误,具体输出如下:
npm run dev > dev > shopify app dev To run this command, log in to Shopify. 👉 Press any key to open the login page on your browser ╭─ error ───────────────────────────────────────────────────────╮ │ │ │ The requested scope is invalid, unknown, or malformed. │ │ │ ╰───────────────────────────────────────────────────────────────╯
浏览器跳转至本地回调页面后,显示:
Something went wrong!
There was an issue while trying to authenticate.
Return to your terminal and try running the previous command again.
排查与解决步骤
- 检查应用配置文件(如
shopify.app.toml)中的scopes字段,确认权限名称拼写正确、无多余标点(如错误的逗号、空格),且均为Shopify官方支持的权限值(例如read_products、write_orders)。 - 清除本地认证缓存:执行
shopify auth logout命令,之后重新运行npm run dev。 - 升级Shopify CLI至最新版本:执行
npm install -g @shopify/cli,确保CLI版本与应用模板兼容。 - 登录Shopify合作伙伴后台,核对应用的权限设置,保证本地配置的scopes与后台一致。
内容的提问来源于stack exchange,提问作者Jey-Es
相关产品推荐
相关产品推荐

