gpt4 book ai didi

javascript - "Workspace needs to be loaded before it is used"on ng new

转载 作者:太空狗 更新时间:2023-10-29 18:27:52 28 4
gpt4 key购买 nike

当我尝试运行 ng new 时出现此代码

sarah @ sarah-Inspiron-5567 ~/Projects
└─ $ ▶ ls
sarah @ sarah-Inspiron-5567 ~/Projects
└─ $ ▶ ng new my-angular-app
Workspace needs to be loaded before it is used.
Error: Workspace needs to be loaded before it is used.
at Workspace._assertLoaded (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:69:19)
at Workspace._getTool (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:175:14)
at Workspace.getCli (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:157:21)
at Object.getConfiguredPackageManager (/usr/local/lib/node_modules/@angular/cli/utilities/config.js:131:32)
at Object.getPackageManager (/usr/local/lib/node_modules/@angular/cli/utilities/package-manager.js:32:35)
at NewCommand.createWorkflow (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:156:47)
at NewCommand.initialize (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:39:14)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
sarah @ sarah-Inspiron-5567 ~/Projects
└─ $ ▶

关于我的环境的信息:

  • 节点:v10.15.3
  • npm: 6.4.1
  • Angular CLI:7.3.8
  • SO:Linux Mint 19.1

最佳答案

似乎是根目录中的 .angular-config.json 文件导致了这个问题。删除后问题没有了:

rm ~/.angular-config.json

另见 this issue

关于javascript - "Workspace needs to be loaded before it is used"on ng new,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55601510/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com