ng g component <ComponentName> Failed with error "Project "undefined" does not exist."
See original GitHub issueCommand
generate
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
After updated to angular14, the defaultProject
property in angular.json was removed after run ng update
, however, when i
try to create an component with ng g component
command, it failed with “Project “undefined” does not exist.” error, if i add defaultProject
back to angular.json, the command will success, but a warning appeared in the console output “DEPRECATED: The ‘defaultProject’ workspace option has been deprecated. The project to use will be determined from the current working directory.”
Minimal Reproduction
- run
ng g component <componentName>
Exception or Error
No response
Your Environment
✗ npm run ng -- version
> blog-admin@0.0.0 ng
> ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 14.2.1
Node: 16.13.1
Package Manager: npm 8.19.0
OS: darwin x64
Angular: 14.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker
### Anything else relevant?
_No response_
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
Angular 14 not able to create components - Stack Overflow
0.2 but when I try to create new component, it throw following error. ng g c views/multi-select Project "undefined" does not exist. following...
Read more >angular/angular-cli - Gitter
Hi I'm getting this error with webpack. TypeError: _firebase_appWEBPACK_IMPORTED_MODULE0default.a.registerVersion is not a function at auth.esm.js:372.
Read more >Angular unit testing tutorial with examples - LogRocket Blog
This tutorial demonstrates how to build an Angular app and write a unit test, test an async operator, and automatically generate a unit ......
Read more >ng generate - Angular
Do not import this component into the owning NgModule. boolean, false. --skip-selector. Specifies if the component should have a selector or not.
Read more >Nastran Dmap Error Message List - Siemens PLM
USER FATAL MESSAGE 37 (XGPIDG). ERROR IN DMAP INSTRUCTION %1 INSTRUCTION NO.%2. WARNING ONLY - MAY NOT BE ENOUGH FILES AVAILABLE FOR. MODULE...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After I changed
blog-admin-e2e.root
toe2e
, things worked, thanks for helpThe problem here is that your projects are misconfigured in the
angular.json
. You have two projects in the same directory as theroot
is configured the same, as such the CLI cannot determine which project you intend to use.