【问题标题】:SyntaxError: Unexpected token ] in JSON at position 550 - Storybook with AngularSyntaxError: Unexpected token ] in JSON at position 550 - Storybook with Angular
【发布时间】:2021-04-27 02:37:44
【问题描述】:

我正在尝试将故事书添加到我的项目中,但出现此错误

为您的“Angular”应用添加 Storybook 支持 SyntaxError: Unexpected token ] 在 JSON 中的位置 550 在 JSON.parse() 在 readFileAsJson (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\helpers.js:60:15) 在 getAngularAppTsConfigJson (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\generators\ANGULAR\angular-helpers.js:47:38) 在 editAngularAppTsConfig (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\generators\ANGULAR\index.js:23:70) 在生成器 (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\generators\ANGULAR\index.js:52:3) 在 runGenerator (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\initiate.js:162:37) 在 installStorybook (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\initiate.js:206:10) 在 _default (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\initiate.js:277:10) 在指挥部。 (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\dist\generate.js:34:566) 在 Command.listener [as _actionHandler] (C:\Users\Marouen\AppData\Roaming\npm-cache_npx\17500\node_modules@storybook\cli\node_modules\commander\index.js:413:31)

当我尝试开始时

npx -p @storybook/cli sb init

我使用 JSON linter 检查了 Angular.json,并且文件已通过验证!有谁知道如何解决这个问题??

【问题讨论】:

  • 也许你的 JSON 无效?
  • @Justinas 我复制粘贴到jsonlint.com 并验证了文件

标签: javascript json angular storybook


【解决方案1】:

由于 angular.json 中的尾随逗号,我遇到了类似的问题。请再次检查或分享您的解决方案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-03
    • 2019-11-17
    • 2019-09-20
    • 2020-10-23
    • 1970-01-01
    • 2022-01-22
    • 2021-09-30
    • 2017-12-15
    相关资源
    最近更新 更多