progressive-web-apps - shopware-pwa 初始化中的安装错误
问题描述
我正在尝试安装shopware-pwa
. 我正在按照中的步骤https://github.com/vuestorefront/shopware-pwa
但是在初始化项目的第一步npx @shopware-pwa/cli init
安装时我使用了默认选项:
* Shopware instance address: · https://shopware6-demo.vuestorefront.io
* Shopware instance access token: · SWSCVJJET0RQAXFNBMTDZTV1OQ
* Which version you'd like to use: latest stable (recommended)
Error: Command failed: npx --ignore-existing create-nuxt-app@3.2.0 --answers "{\"name\":\"shopware-pwa-project\",\"description\":\"shopware-pwa-project description\",\"author\":\"Vue Storefront\",\"pm\":\"yarn\",\"ui\":\"none\",\"language\":\"js\",\"server\":\"none\",\"features\":[\"axios\",\"pwa\"],\"linter\":[\"prettier\",\"lintStaged\"],\"test\":\"jest\",\"mode\":\"universal\",\"target\":\"server\",\"devTools\":[],\"gitUsername\":\"\",\"ci\":\"none\"}"
npx: the --ignore-existing argument has been removed.
See `npm help exec` for more information
Trace: Error: Answers JSON could not be parsed (Unexpected token n in JSON at position 1)
at SAO.runGenerator (/home/user/.npm/_npx/059d932392171cf4/node_modules/sao/lib/index.js:126:15)
at SAO.run (/home/user/.npm/_npx/059d932392171cf4/node_modules/sao/lib/index.js:101:16)
at /home/user/.npm/_npx/059d932392171cf4/node_modules/create-nuxt-app/lib/cli.js:51:17
有人提出这个问题吗?
解决方案
我在 create-nuxt-app GitHub 存储库中发现了问题 #612 。似乎在 --answers 参数之后,您必须以单引号 (') 开头,然后将配置粘贴为 JSON。JSON 不得包含任何换行符/回车符,并且属性之间不得有任何空格 ( )。
因此,在您的情况下,您的 bash 命令应如下所示:
npx --ignore-existing create-nuxt-app@3.2.0 --answers '{"name":"shopware-pwa-project","description":"shopware-pwa-project description","author":"Vue Storefront","pm":"yarn","ui":"none","language":"js","server":"none","features":["axios","pwa"],"linter":["prettier","lintStaged"],"test":"jest","mode":"universal","target":"server","devTools":[],"gitUsername":"","ci":"none"}'
我刚刚在我的机器上尝试过它并且它有效。我只收到警告,因为该--ignore-existing
论点已被删除。希望这能解决您的问题!
问候
推荐阅读
- sorting - 使用 frama-c 的递归快速排序的正式证明
- wcf - 增加 WCF 服务终结点大小配置的问题
- python - SimpleCookie 泛型类型
- java - 将配置传递给 Kafka 客户端的推荐方法
- typescript - 打字稿对象值扩展类型
- authorization - ActivePivot 授权
- python - vscode 运行所有测试(pytest)失败
- oracle - 2个符号oracle之间的相似性
- openid-connect - prompt=login 和 prompt=none 如何在 OpenAM-6.5.2 中工作
- javascript - 类型“JQuery”上不存在属性“掩码”