nativescript-schematics
nativescript-schematics copied to clipboard
Cannot find module '@schematics/angular/utility/parse-name'
I installed @nativescript/[email protected] for my Nativescript project and tried to generate component using command its show me following error.
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/parse-name'
See "/private/var/folders/g0/3gly57n500zb1xvl7rffy_100000gn/T/ng-Mxey0g/angular-errors.log" for further details.
here is errors.log
[error] Error: Cannot find module '@schematics/angular/utility/parse-name'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.
when I downgrade @nativescript/[email protected] to @nativescript/[email protected] its working fine.
Hi @kdmakwana43,
Does your project have a dependency on @angular/cli
?
The @nativescript/schematics
package tries to require a utility function from @schematics/angular
. @schematics/angular
is a dependency of @angular/cli
. To fix the error, install the Angular CLI in your project:
npm install -D @angular/cli
This worked for me. npm i --save-dev @nativescript/schematics
Hi @kdmakwana43,
Does your project have a dependency on
@angular/cli
? The@nativescript/schematics
package tries to require a utility function from@schematics/angular
.@schematics/angular
is a dependency of@angular/cli
. To fix the error, install the Angular CLI in your project:npm install -D @angular/cli
That works for me. Love you! :)
Hi @kdmakwana43, Does your project have a dependency on
@angular/cli
? The@nativescript/schematics
package tries to require a utility function from@schematics/angular
.@schematics/angular
is a dependency of@angular/cli
. To fix the error, install the Angular CLI in your project:npm install -D @angular/cli
That works for me. Love you! :)
I just login to say it work and thank you
This worked for me. npm i --save-dev @nativescript/schematics
Thanks! It works for me!
npm install -D @angular/cli
npm i --save-dev @nativescript/schematic
These Commands Collectively helped me
The following fixed the issue for me :
npm i --save-dev @nativescript/schematics
Nothing helped me.
First, I had an error:
Cannot find module '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'
Running
npm install -D @angular/cli
command turned error into familiar this post error.
After running
npm i --save-dev @nativescript/schematics
the next error appeared:
Error: Invalid rule result: Instance of class Promise. at t.r.pipe.o.mergeMap.r [as project] (C:\Users\taekw\AppData\Roaming\npm\node_modules\nativescript\node_modules@nativescript\schematics-executor\dist\index.js:250:1038) at t._tryNext (C:\Users\taekw\AppData\Roaming\npm\node_modules\nativescript\node_modules@nativescript\schematics-executor\dist\index.js:30:1878) at t._next (C:\Users\taekw\AppData\Roaming\npm\node_modules\nativescript\node_modules@nativescript\schematics-executor\dist\index.js:30:1780) at t.next (C:\Users\taekw\AppData\Roaming\npm\node_modules\nativescript\node_modules@nativescript\schematics-executor\dist\index.js:16:1093) at e._subscribe (C:\Users\taekw\AppData\Roaming\npm\node_modules\nativescript\node_modules@nativescript\schematics-executor\dist\index.js:74:13873) at e._trySubscribe etc..
Hey @AndrePu ,
Can you send us your package.json? Can you try updating all of your Angular dependencies (remove your package-lock.json
before that) and see if this resolves the issue on your side?
I am also have this problem when trying to use the cli to generate a component: Error: Invalid rule result: Instance of class Promise.
I've done all the steps suggested above including updating the angular dependencies.
I created a new project based on this template: tns create --template tns-template-drawer-navigation-ng
Attempted to create a component: tns generate c home/test and received this error: Cannot find module '@schematics/angular/utility/parse-name'
Next ran: npm i --save-dev @nativescript/schematics And then: tns generate c home/test, and received error: Cannot find module '@schematics/angular/utility/parse-name'
Uninstalled @nativescript/schematics Ran npm install -D @angular/cli And then tns generate c home/test and received the error: Cannot find module '@schematics/angular/utility/parse-name'
Installed @nativescript/schematics Ran tns generate c home/test and received: Error: Invalid rule result: Instance of class Promise. at t.r.pipe.o.mergeMap.r [as project] (C:\Users\Mark\AppData\Roaming\npm\node_modules\nativescript\node_modules@nativescript\schematics-executor\dist\index.js:250:1038)
I went back to my old project, and because I had deleted the package-lock.json I decided to run:
npm i @nativescript/angular
And now I can generate a component.
This worked for me. npm i --save-dev @nativescript/schematics
Saved my day. Thank you!
typescript has been moved to @schematics/angular/node_modules/typescript/lib/typescript" Find and replace all to the new location.
hello,
I have been trying to install Angular Material in a new Angular 9 project with ng add @angular/material but I am getting this error too: Cannot find module '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'
I have installed the npm i @nativescript/angular and npm install -D @angular/cli but nothing helped so far.
Anybody any idea what else I can try or another way to install Angular Material?
hello, I have been trying to install Angular Material in a new Angular 9 project with ng add @angular/material but I am getting this error too:
Cannot find module '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'
I have installed the npm i @nativescript/angular and npm install -D @angular/cli but nothing helped so far.
Anybody any idea what else I can try or another way to install Angular Material?
typescript has been moved to @schematics/angular/node_modules/typescript/lib/typescript" Find and replace all to the new location.
hello, I have been trying to install Angular Material in a new Angular 9 project with ng add @angular/material but I am getting this error too:
Cannot find module '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'
I have installed the npm i @nativescript/angular and npm install -D @angular/cli but nothing helped so far. Anybody any idea what else I can try or another way to install Angular Material?typescript has been moved to @schematics/angular/node_modules/typescript/lib/typescript" Find and replace all to the new location.
@realivatesolutions thank you!
Hi @kdmakwana43,
Does your project have a dependency on
@angular/cli
? The@nativescript/schematics
package tries to require a utility function from@schematics/angular
.@schematics/angular
is a dependency of@angular/cli
. To fix the error, install the Angular CLI in your project:npm install -D @angular/cli
This working for me !
npm install -D @angular/cli npm i --save-dev @nativescript/schematics
These two commands also helped me
when I try to add --> ng add @angular/material to my new project throwing me a error Cannot find module '@schematics/angular/utility/project' Require stack:
- D:\Web_portal\Web_portal\webangular\node_modules@angular\cdk\schematics\utils\build-component.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular\cdk\schematics\utils\index.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular\material\schematics\ng-add\setup-project.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular-devkit\schematics\tools\export-ref.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular-devkit\schematics\tools\index.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular\cli\utilities\json-schema.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular\cli\models\command-runner.js
- D:\Web_portal\Web_portal\webangular\node_modules@angular\cli\lib\cli\index.js
- C:\Users\Minisha\AppData\Roaming\npm\node_modules@angular\cli\lib\init.js
- C:\Users\Minisha\AppData\Roaming\npm\node_modules@angular\cli\bin\ng
Anyone help me how to solve it.
I am experiencing the same issue but with normal ng generate component command.
Same issue with ng generate component.
Same issue with ng generate component.
Inspecting an old project, found "project.d.ts" and "project.js" under "@schematics\angular\utility". Just copied those 2 files to my new project, and it worked. Surely not a good practice tho.
Same issue with ng g c newcomponent
I tried all previous steps but nothing worked for me
Trying to add a component with: ng generate component my-name
I get this:
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project'
Require stack:
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@nativescript\schematics\src\angular-project-parser.js
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@nativescript\schematics\src\generate\component\index.js
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@angular-devkit\schematics\tools\index.js
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@angular\cli\utilities\json-schema.js
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@angular\cli\models\command-runner.js
- C:\Users\Me\Documents\Prog\Crossplat\my-angular-app\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\Me\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
- C:\Users\Me\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
These are my current versions: Angular: 9.1.11 Angular CLI: 10.0.0 Node: 12.18.1
Something about the Schematics that screw this up it seems...
@Holei94 I had the same issue after updating my @angular/cli
dependency to v 10.0.0 (like you). I just tried it against v 9.1.8 and it worked.
I also tried the various other suggestions, such as installing @schematics/angular
, but no luck. Might be an issue with the latest angular cli (v10+).
TLDR: I downgraded to v 9.x.x of the @angular/cli
and thereafter ng generate component abc
worked.
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project'
Hi all. I have to write this due to I can figure out how to fix this problem. When I try to generate a component I have an issue:
ng g c challenges/challenge-edit
Then I get this:
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project' Require stack:
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@nativescript\schematics\src\angular-project-parser.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@nativescript\schematics\src\generate\component\index.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular-devkit\schematics\tools\export-ref.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular-devkit\schematics\tools\index.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\utilities\json-schema.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\models\command-runner.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\lib\cli\index.js
- C:\Users\julia\AppData\Roaming\npm\node_modules@angular\cli\lib\init.js
- C:\Users\julia\AppData\Roaming\npm\node_modules@angular\cli\bin\ng See "C:\Users\julia\AppData\Local\Temp\ng-qOzXJZ\angular-errors.log" for further details.
I have tried to run the commands above:
npm install -D @angular/cli
npm i --save-dev @nativescript/schematics
But unfortunately the issue persist
To be honest I do not know what is the problem, I am running Angular CLI: 10.0.1 npm 6.14.5 nativeScript 6.7.4
I would appreciate any help to fix it.
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project'
Hi all. I have to write this due to I can figure out how to fix this problem. When I try to generate a component I have an issue:
ng g c challenges/challenge-edit
Then I get this:
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project' Require stack:
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@nativescript\schematics\src\angular-project-parser.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@nativescript\schematics\src\generate\component\index.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular-devkit\schematics\tools\export-ref.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular-devkit\schematics\tools\index.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\utilities\json-schema.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\models\command-runner.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\lib\cli\index.js
- C:\Users\julia\AppData\Roaming\npm\node_modules@angular\cli\lib\init.js
- C:\Users\julia\AppData\Roaming\npm\node_modules@angular\cli\bin\ng See "C:\Users\julia\AppData\Local\Temp\ng-qOzXJZ\angular-errors.log" for further details.
I have tried to run the commands above:
npm install -D @angular/cli
npm i --save-dev @nativescript/schematics
But unfortunately the issue persist
To be honest I do not know what is the problem, I am running Angular CLI: 10.0.1 npm 6.14.5 nativeScript 6.7.4
I would appreciate any help to fix it.
Downgrade @angular/cli to 9.1.8, just as above poster said.
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project'
Hi all. I have to write this due to I can figure out how to fix this problem. When I try to generate a component I have an issue:
ng g c challenges/challenge-edit
Then I get this:An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project' Require stack:
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@nativescript\schematics\src\angular-project-parser.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@nativescript\schematics\src\generate\component\index.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular-devkit\schematics\tools\export-ref.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular-devkit\schematics\tools\index.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\utilities\json-schema.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\models\command-runner.js
- C:\Users\julia\Desktop\PROGRAMMING\UDEMY\ANGULAR\MAXIMILIAN SCH\NATIVESCRIPT\PROJECTS\RoutingANDNavigation\node_modules@angular\cli\lib\cli\index.js
- C:\Users\julia\AppData\Roaming\npm\node_modules@angular\cli\lib\init.js
- C:\Users\julia\AppData\Roaming\npm\node_modules@angular\cli\bin\ng See "C:\Users\julia\AppData\Local\Temp\ng-qOzXJZ\angular-errors.log" for further details.
I have tried to run the commands above:
npm install -D @angular/cli
npm i --save-dev @nativescript/schematics
But unfortunately the issue persist To be honest I do not know what is the problem, I am running Angular CLI: 10.0.1 npm 6.14.5 nativeScript 6.7.4 I would appreciate any help to fix it.Downgrade @angular/cli to 9.1.8, just as above poster said.
Thanks dude. Gracias amigo.
I Downgraded just the dependency @schematics and it works now.
npm uninstall @schematics/angular
npm cache clean
npm install @schematics/[email protected]
the normal solution to try is :
npm install -D @angular/cli
make sure you have nativescript/schematics in your package.json . otherwise add it with :
npm i --save-dev @nativescript/schematics
if you still get the same problem, this because you have incompatible version between dependencies ,for example @angular/[email protected] and nativescript/[email protected] . in this case you have to downgrade the appropriate dependency to 9.x.x :
npm uninstall @schematics/angular npm cache clean npm install @schematics/[email protected]