template-nativescript-nx
template-nativescript-nx copied to clipboard
Error creating app from template
I get this error when I try creating an app from this template:
tns create my-nx-app --template https://github.com/NathanWalker/template-nativescript-nx Installing https://github.com/NathanWalker/template-nativescript-nx
- Preparing NativeScript for Nx.
- Cleaning up.
- NativeScript for Nx is finalizing...
- [email protected] added 3 packages in 15.099s npm ERR! code ENOLOCAL npm ERR! Could not install from "....\node_modules@angular\animations" as it does not contain a package.json file.
Please advise what I am missing.
Try installing @angular/animations in the Nx workspace
Thanks @breningham - yes @shawndewet depending on your app needs, you may want to install some supporting packages into the root of the workspace, ie:
npm i @angular/animations @angular/http --save
After installing those at the root, you can simply navigate directly into the mobile app and run npm i again. (ie: cd apps/mobile && npm i)
My problem is that after the "tns create" command I am executing fails with the message indicated above, the folder is empty....there is no package.json file into which the "npm i @angular/animations --save" can be installed and saved into. As the "tns create" command is executing, I can see the folder structure get populated with files...but then after the failure it all gets rolled back, and I am left with an empty folder again.
Uhg I had a brain fart...I just realised that for this to work I need to be in the "apps" folder of an existing nx workspace!!! Sorry for wasting your time!
Ok, now I am running the "tns create" command from within the "apps" folder of my workspace, and I am getting this error:
npm ERR! code ENOLOCAL npm ERR! Could not install from "....\node_modules@ngrx\effects" as it does not contain a package.json file.
Then from the root of the workspace, when I run "npm i @ngrx\effects --save", I get this:
npm ERR! code ENOLOCAL npm ERR! Could not install from "@ngrx\effects" as it does not contain a package.json file.
What am I doing wrong? (Might be worth mentioning that I am in a workspace that I migrated from an existing AngularCLI project as instructed here:
I found a different issue that also produced the same issue that the OP reported: "Could not install from "......\node_modules@angular\animations" as it does not contain a package.json file."
I realized that in the nativeScript app's package.json file it was adding too many ..\ to the front of every file reference. By changing ..\..\..\ to ..\..\ I got it to function correctly.