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

Dung Do Tien Nov 06 2020 1429

I just installed the package @nativescript/[email protected] for my project and tried to generate component but I got an error as below:
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/parse-name'
here is a detailed log bug in the log file in my application:

[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)

Thank you for any suggestions!!

Have 2 answer(s) found.
  • M

    Marry Christ Nov 08 2020

    I think your project depends on @angular/cli.
    The @nativescript/schematics package tries to require a utility function from @schematics/angular but @schematics/angular is a depend on @angular/cli. You can try to install angular CLI as below:

    npm install -D @angular/cli 

    I hope it resolves the issue for you.

  • S

    Sandeep Kumar Nov 08 2020

    I try the install command below, it worked for me.

    npm i --save-dev @nativescript/schematics 


Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close