Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '@schematics/angular/utility/parse-name' #241

Open
kdmakwana43 opened this issue Aug 17, 2019 · 37 comments
Open

Cannot find module '@schematics/angular/utility/parse-name' #241

kdmakwana43 opened this issue Aug 17, 2019 · 37 comments

Comments

@kdmakwana43
Copy link

I installed @nativescript/schematics@0.7.0 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. (/Users/apple/Codenatial/nativescript/demo/node_modules/@nativescript/schematics/src/generate/component/index.js:6:22)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

when I downgrade @nativescript/schematics@0.7.0 to @nativescript/schematics@0.6.0 its working fine.

@sis0k0
Copy link
Contributor

sis0k0 commented Aug 26, 2019

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

@ronolivarph
Copy link

This worked for me.
npm i --save-dev @nativescript/schematics

@luenmuvel
Copy link

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! :)

@likhi1
Copy link

likhi1 commented Sep 7, 2019

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

@edrockfsd
Copy link

This worked for me.
npm i --save-dev @nativescript/schematics

Thanks! It works for me!

@WaseemAhmadZ
Copy link

npm install -D @angular/cli
npm i --save-dev @nativescript/schematic

These Commands Collectively helped me

@arunabhdas
Copy link

The following fixed the issue for me :

npm i --save-dev @nativescript/schematics

@AndrePu
Copy link

AndrePu commented Nov 8, 2019

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..

@rosen-vladimirov rosen-vladimirov added this to Inbox in CLI Team via automation Nov 11, 2019
@rosen-vladimirov
Copy link

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?

@mchallenger88
Copy link

mchallenger88 commented Nov 22, 2019

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.

@mchallenger88
Copy link

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)

@mchallenger88
Copy link

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.

@Dyloneus
Copy link

This worked for me.
npm i --save-dev @nativescript/schematics

Saved my day. Thank you!

@realivatesolutions
Copy link

typescript has been moved to @schematics/angular/node_modules/typescript/lib/typescript"
Find and replace all to the new location.

@linocatucci
Copy link

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?

@realivatesolutions
Copy link

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.

@linocatucci
Copy link

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!

@jovanymezura
Copy link

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 !

@Comfie
Copy link

Comfie commented Jun 9, 2020

npm install -D @angular/cli
npm i --save-dev @nativescript/schematics

These two commands also helped me

@MinishaFinsurge
Copy link

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.

@ayush-codebase
Copy link

I am experiencing the same issue but with normal ng generate component command.

@th3hunter
Copy link

Same issue with ng generate component.

@th3hunter
Copy link

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.

@Nasma-Izazi
Copy link

Same issue with ng g c newcomponent

I tried all previous steps but nothing worked for me

@Holei94
Copy link

Holei94 commented Jun 27, 2020

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...

@mikstur
Copy link

mikstur commented Jun 28, 2020

@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.

@ProgrammerRomero
Copy link

ProgrammerRomero commented Jul 2, 2020

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.

@th3hunter
Copy link

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.

@ProgrammerRomero
Copy link

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/angular@9.1.8

@hamdirhibi
Copy link

hamdirhibi commented Jul 4, 2020

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/cli@10.x.x and nativescript/schematics@9.x.x . in this case you have to downgrade the appropriate dependency to 9.x.x :

npm uninstall @schematics/angular
npm cache clean
npm install @schematics/angular@9.1.8

@vapstor
Copy link

vapstor commented Jul 8, 2020

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/angular@9.1.8

this work, thank you:
tip use npm cache clean --force
and after that in some json files i need to remove comments

@JasonEdLewis
Copy link

Does this solution work for the same error encountered in a code sharing environment? When I run:
npm i --save-dev @nativescript/schematics
I get the following error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @nativescript/schematics@~2.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/owner/.npm/_logs/2020-08-02T14_32_06_441Z-debug.log

Then going to the log, I see this:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'i',
1 verbose cli   '--save-dev',
1 verbose cli   '@nativescript/schematics' ]
2 info using npm@6.14.7
3 info using node@v10.16.3
4 verbose npm-session ab573dfebc8448d0
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/@nativescript%2fschematics 703ms
8 silly fetchPackageMetaData error for @nativescript/schematics@~2.0.0 No matching version found for @nativescript/schematics@~2.0.0.
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 1075ms
11 verbose type range
12 verbose stack @nativescript/schematics: No matching version found for @nativescript/schematics@~2.0.0.
12 verbose stack     at pickManifest (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:122:13)
12 verbose stack     at fetchPackument.then.packument (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:24:14)
12 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
12 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
12 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
12 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
12 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:699:18)
12 verbose stack     at _drainQueueStep (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
12 verbose stack     at _drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
12 verbose stack     at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
12 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
12 verbose stack     at runCallback (timers.js:705:18)
12 verbose stack     at tryOnImmediate (timers.js:676:5)
12 verbose stack     at processImmediate (timers.js:658:5)
13 verbose cwd /Users/owner/Desktop/angular/familyMaster/familyseedsshared
14 verbose Darwin 19.5.0
15 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "--save-dev" "@nativescript/schematics"
16 verbose node v10.16.3
17 verbose npm  v6.14.7
18 error code ETARGET
19 error notarget No matching version found for @nativescript/schematics@~2.0.0.
20 error notarget In most cases you or one of your dependencies are requesting
20 error notarget a package version that doesn't exist.
21 verbose exit [ 1, true ]

Thanks in advance!

@NathanWalker
Copy link
Contributor

@JasonEdLewis looks like you have old incorrect version installed globally:

No matching version found for @nativescript/schematics@~2.0.0

The latest is 10.0.1
You may try installing globally again.
npm i -g @nativescript/schematics

@JasonEdLewis
Copy link

@JasonEdLewis looks like you have old incorrect version installed globally:

No matching version found for @nativescript/schematics@~2.0.0

The latest is 10.0.1
You may try installing globally again.
npm i -g @nativescript/schematics

Thank you soo much Nathan!! I appreciate your work on this project, your time and you getting me over this hurdle!!

@psahni
Copy link

psahni commented Dec 30, 2020

npm install @schematics/angular@9.1.8

This worked for me.
Thanks @vapstor

@luisVargasGu
Copy link

luisVargasGu commented Feb 12, 2021

This may be an issue with my versions now but after following all the above steps I get another error.
Package.json:

"devDependencies": {
"@angular/cli": "~9.1.8",
"@angular/compiler-cli": "^11.2.0",
"@nativescript/android": "7.0.1",
"@nativescript/schematics": "10.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~4.0.0",
"@ngtools/webpack": "~11.0.0",
"@schematics/angular": "^9.1.8",
"tslint": "^6.1.3",
"typescript": "~4.0.0"
}
Error:
nsconfig.json not found. Assuming this is a {N} only project
Project is not configured for NativeScript, while --web is set to false

Furthermore with this other configuration of devDependencies I get a different error.
"devDependencies": {
"@angular/cli": "^9.1.0",
"@angular/compiler-cli": "~11.0.0",
"@nativescript/android": "7.0.1",
"@nativescript/schematics": "^11.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~4.0.0",
"@ngtools/webpack": "~11.0.0",
"@schematics/angular": "^9.1.0",
"tslint": "^6.1.3",
"typescript": "~4.0.0"
}
error:
ng g c abc
Could not find an NgModule. Use the skip-import option to skip importing in NgModule.

ng g c abc --skip-import
Failed to generate remapped imports! Please see: https://docs.nativescript.org/angular/code-sharing/intro#remapped-imports
CREATE src/app/abc/abc.component.html (18 bytes)
CREATE src/app/abc/abc.component.spec.ts (607 bytes)
CREATE src/app/abc/abc.component.ts (262 bytes)
CREATE src/app/abc/abc.component.css (0 bytes)
CREATE src/app/abc/abc.component.tns.css (49 bytes)
CREATE src/app/abc/abc.component.tns.html (59 bytes)

desired would not need the skip flag, update app.component, and generate files without .tns bc its mobile only

@seyhmusozbek
Copy link

This may be an issue with my versions now but after following all the above steps I get another error.
Package.json:

"devDependencies": {
"@angular/cli": "~9.1.8",
"@angular/compiler-cli": "^11.2.0",
"@nativescript/android": "7.0.1",
"@nativescript/schematics": "10.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~4.0.0",
"@ngtools/webpack": "~11.0.0",
"@schematics/angular": "^9.1.8",
"tslint": "^6.1.3",
"typescript": "~4.0.0"
}
Error:
nsconfig.json not found. Assuming this is a {N} only project
Project is not configured for NativeScript, while --web is set to false

Furthermore with this other configuration of devDependencies I get a different error.
"devDependencies": {
"@angular/cli": "^9.1.0",
"@angular/compiler-cli": "~11.0.0",
"@nativescript/android": "7.0.1",
"@nativescript/schematics": "^11.0.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~4.0.0",
"@ngtools/webpack": "~11.0.0",
"@schematics/angular": "^9.1.0",
"tslint": "^6.1.3",
"typescript": "~4.0.0"
}
error:
ng g c abc
Could not find an NgModule. Use the skip-import option to skip importing in NgModule.

ng g c abc --skip-import
Failed to generate remapped imports! Please see: https://docs.nativescript.org/angular/code-sharing/intro#remapped-imports
CREATE src/app/abc/abc.component.html (18 bytes)
CREATE src/app/abc/abc.component.spec.ts (607 bytes)
CREATE src/app/abc/abc.component.ts (262 bytes)
CREATE src/app/abc/abc.component.css (0 bytes)
CREATE src/app/abc/abc.component.tns.css (49 bytes)
CREATE src/app/abc/abc.component.tns.html (59 bytes)

desired would not need the skip flag, update app.component, and generate files without .tns bc its mobile only

Same here, i hope someone could help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
CLI Team
  
Inbox
Development

No branches or pull requests