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

Error creating app from template #9

Open
shawndewet opened this issue Jan 9, 2018 · 6 comments
Open

Error creating app from template #9

shawndewet opened this issue Jan 9, 2018 · 6 comments

Comments

@shawndewet
Copy link

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

  1. Preparing NativeScript for Nx.
  2. Cleaning up.
  3. 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.

@breningham
Copy link

Try installing @angular/animations in the Nx workspace

@NathanWalker
Copy link
Owner

NathanWalker commented Jan 14, 2018

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)

@shawndewet
Copy link
Author

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.

@shawndewet
Copy link
Author

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!

@shawndewet
Copy link
Author

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:

@erik-slack
Copy link

erik-slack commented Oct 13, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants