首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么在运行Nrwl nx cli时出现此错误?

为什么在运行Nrwl nx cli时出现此错误?
EN

Stack Overflow用户
提问于 2020-11-03 10:28:58
回答 1查看 753关注 0票数 0

我一直在尝试学习和使用nwrl nx框架来使用angular应用程序创建一个新的mono存储库。但是,当尝试将nx cli用于任何命令时,我得到以下错误:

代码语言:javascript
复制
    at JSON.parse (<anonymous>)
    at Object.parseJsonWithComments (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/utils/fileutils.js:43:17)
    at new TargetProjectLocator (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/core/target-project-locator.js:14:46)
    at buildExplicitTypeScriptDependencies (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/core/project-graph/build-dependencies/explicit-project-dependencies.js:7:34)
    at buildDependenciesFns.forEach (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:60:41)
    at Array.forEach (<anonymous>)
    at buildProjectGraph (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:60:26)
    at Object.createProjectGraph (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/core/project-graph/project-graph.js:39:30)
    at Object.<anonymous> (/Users/bendunc/Documents/MTC Apps/mtc-language/node_modules/@nrwl/workspace/src/command-line/run-one.js:15:46)
    at Generator.next (<anonymous>)
(node:5280) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5280) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

每当我运行nx命令时,我都会得到这个错误。

代码语言:javascript
复制
nx serve <app name>

代码语言:javascript
复制
npx ng serve <app name>

我已经尝试过卸载并重新安装nx cli,但都无济于事。如有任何帮助或建议,我们将不胜感激。

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-05 11:08:09

一位同事帮我解决了这个问题。问题是我的tsconfig.json文件中有一个尾随逗号,而JSON不允许尾随逗号。因此,如果您遇到类似的错误,请确保nx/angular项目中的主JSON文件格式正确。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64655992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档