angular - 错误:在工作区中找不到项目“开始”
问题描述
ng run start:en 命令是抛出异常。
Project 'start' could not be found in workspace.
Error: Project 'start' could not be found in workspace.
at Workspace.getProject (...node_modules\@angular-devkit\core\src\workspace\workspace.js:93:19)
at Architect.getBuilderConfiguration (node_modules\@angular-devkit\architect\src\architect-legacy.js:117:41)
at RunCommand.runSingleTarget (\node_modules\@angular\cli\models\architect-command.js:160:45)
at RunCommand.runArchitectTarget (node_modules\@angular\cli\models\architect-command.js:201:35)
at RunCommand.run node_modules\@angular\cli\commands\run-impl.js:14:25)
at RunCommand.validateAndRun (node_modules\@angular\cli\models\command.js:124:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.
Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
包.json
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:ur": "ng serve --configuration=ed",
"start:en": "ng serve --configuration=en",
"build": "ng build",
"build:ur": "ng build --configuration=ed",
"build:en": "ng build --configuration=en",
...
}
我已经尝试了从谷歌堆栈溢出中获得的所有可能的解决方案
- 删除
node_module
文件夹 package-lock.json
- 更改 npm 版本
解决方案
要从 运行命令package.json
,您需要使用 调用它们npm run
。npm
将调用里面的脚本package.json
。
因此,对于您要在其中运行start:en
脚本的问题package.json
,您需要运行
npm run start:en
推荐阅读
- reactjs - i18next-scanner 删除多个值
- .net - 提供程序:命名管道提供程序,错误:40 - 无法打开与 SQL Server 2012 的连接
- python - 如何在 Django 中创建一个支持用户可安装的第三方插件集成的架构
- c# - 如何将 Singleton DI 用于 Microsoft DistributedRedisCache?
- oracle - 如何在 oracle XML 中省略 XMLForest 函数中使用的别名
- api - Jmeter 在主机中发现非法字符:'/' ISSUE
- java - Spring 5 - @Bean 方法的自定义限定符 - NoSuchBeanDefinitionException
- java - 如何从另一个类刷新 TextView?
- vim - Vim 按升序生成数字
- python - 查找具有特定字段内容的用户文档