I'm diving into nativescript development for the first time and I'm attempting to create a new component using this command: ng g c component-name
The error message that's popping up reads: An unhandled exception occurred - Cannot find module '@schematics/angular/utility/parse-name'
I've executed the following commands:
npm i -D @nativescript/schematics @schematics/angular tslint
Even with @schematics/angular version 9.1.0 installed, I keep encountering this error:
Could not find an NgModule. Use the skip-import option to skip importing in NgModule
I prefer not to skip the import process and want components to be automatically included in the modules.
If I do decide to skip the import step, another error shows up related to the TS class of the component:
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.ts(1219)
The 'experimentalDecorators' option is indeed set to true in the tsconfig file, but I'm unsure how to resolve all these issues!
TNS has been configured correctly as verified by running tns doctor without any problems detected.
The Angular and Nativescript versions are both up-to-date:
Angular CLI: 11.1.1 Node: 10.23.1 OS: darwin x64
Angular: 11.0.9
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1101.1 (cli-only)
@angular-devkit/core 10.0.8
@angular-devkit/schematics 11.1.1 (cli-only)
@ngtools/webpack 11.0.7
@schematics/angular 11.1.1 (cli-only)
@schematics/update 0.1101.1 (cli-only)
rxjs 6.6.3
typescript 4.0.5
TNS Doctor:
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.3.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.1.2 version and is up to date.