Default Install Location: IONIC, NODEJS - node.js

I came accross an issue today, when i installed ionic and cordova for a test project. i did this
npm install -g cordova ionic
then
ionic start myapp tabs
Problem that i faced was that nothing happened, i searched around but could not find a reasonable answer. this is what i found:
http://stackoverflow.com/questions/27155486/ionic-start-projectname-not-working-with-ionic-framework
https://forum.ionicframework.com/t/ionic-start-myapp-tabs-not-working/3205
But i believed it is an environment issue. So i cleanedup. removed old builds and did a fresh build but nothing much of success.
Questions:
1) Where is default location for creating the app folder is defined when we do 'start ionic app-name'
2) If app-name folder is not created and command completes without any errors, what should be next course of action.
i hope some one can help out.
ENV: WINDOWS7, NODE.JS, IONIC, CORDOVA

I solved my problem (stated above) by upgrading node.js and reinstalling ionic package after removing it.
Second i also found out that to specify path to app location, below command will work.
ionic start [absolute-path-to-app-folder] [template-optional]
e.g.
ionic start c:\myApp will create a blank app in C drive
Hope this can help someone. i spent a week digging this out.

Related

Different NPM version used when generating React app

When I try to create the starter React tutorial app using powershell, I get the below error:
"You are using npm 2.15.12 so the project will be boostrapped with an old unsupported version of tools".
"Please update to npm 3 or higher for a better, fully supported experience".
However, my NPM version is 6.11.3 as seen below.
What I have tried:
I have ran powershell as admin as answered in this question and restart.
I have also uninstalled and reinstalled Nodejs completely.
So after an extra hour digging around, I saw a few posts with similar (but not exactly) the same issue. I decided to install Yarn and install with that.
After install, I ran yarn cache clean and ran npx create-react-app your-app and it worked. Sorry for bothering you all.
I had the same problem. I'm running WSL with ubuntu, and yarn cache clear didn't work, but I noticed a node modules directory created in the project. I think it was messing with the node version so I deleted it. It worked

Getting started with Create React App - "Cannot find module"

I'm using the "Getting Started" guide because I've been experiencing endless errors trying to create a react app so far when following tutorials.
And straight away I'm running into a problem. When I run npx create-react-app my-app I get the following:
Cannot find module 'C:\Users\Aristophanes\node_modules\create-react-app\index.js'
Can anyone advise me what I'm doing wrong? Thanks.
This must be a problem related with your node installation (maybe you removed manually create-react-app package?). I'd recommend following these steps:
Uninstall node and npm
Delete the npm cache and npm modules in your machine (In Windows machine you can usually find them at C:\Users\ {username} \AppData\Roaming\npm-cache and C:\Users\ {user name} \AppData\Roaming\npm) respectively.
Install node and npm again
If you really don't want to delete node and npm, try step 2 and see if that works. Following these steps did the job for me, hope that helps you.
I think you might miss installing Node and npm in your machine.
I had same issue a few times. Every time I was searching thru net for a solution, and for every time i just typed in terminal
npm i node
and its just started working

error at npm install line, whyle creating an ionic project with ionic start

I am trying to create an ionic project by using
ionic start myApp tabs --type=ionic-angular
but there's an error at npm install line.
I've uninstall and reinstall node, but i still have the same problem. Look at the picture below to have a precise idea
issue screen shoot in terminal
I hope you guys can help. Thanks
To fix this issue, I uninstalled node.js from the control pannel, after that, I deleted those folders C:\Users\userName\AppData\Roaming\npm & C:\Users\userName\AppData\Roaming\npm-cache.
And finally I reinstalled node.js and ionic. Now everything is ok, i can create new projects again

How to completely uninstall Cordova

since I updated my mac to Sierra I noticed a strange behaviour in my cordova app: some plugins aren't working anymore, it just seems they are not copied in the ios platform even if when I add the Platform the plugins' folders are copied as usual. It just seems xcode ignore them.
I tried a few things: removing and adding again plugins, updating cordova, uninstalling and reinstalling cordova, updating platforms, trying creating a brand new app... nothing seems to fix the problem.
Searching around I found this command:
$ cordova platform update ios --save
and it worked without doing anything else.
Unfortunately I have to use this command everytime I make a change in the app and I remove and add the platform again so I guess it's a problem in my environment.
I would like to completely uninstall cordova, node.js and git and reinstall everything again. I found a few instructions like in this question for node.js How do I uninstall nodejs installed from pkg (Mac OS X)? but I don't know how to run correctly all of the commands, some of them fail.
Uninstalling cordova and reinstalling works but doesn't solve the problem.
I did it with
$ sudo npm install -g cordova
$ sudo npm uninstall -g cordova
Can someone link me where to find clear instructions step by step? I'm not that good with command line and I really want to fix this problem without formatting the whole system.
Thank you for any help!
Think I have the solution: I removed cordova,
sudo npm uninstall -g cordova
deleted the .cordova folder in my user home folder (it's a hidden folder!) and installed cordova again with
sudo npm install -g cordova
I noticed that one of my old cordova projects was working: remove platform, add platform and by default I had ios platform version 4.3.0. GOOD!
In another cordova project created after latest update it was still using ios platform 4.2.1.
In the root project folder there is the config.xml file and in this file I found this line in just the second project:
<engine name="ios" spec="~4.2.1" />
Just removed and now cordova is using by default the latest version of the ios platform.
I don't know exactly why in one project there was this line and why not in the other one... neither know if I updated the platform in one project before reinstalling cordova and after reinstalling in onther... can't remember.
I just know that now if I create a new project it's correctly using ios platform 4.3.0 and I tried to describe all my steps...
I hope it will be useful for anyone else because I was ready to format my mac to fix this :(
I don't think you really have a problem with node or npm.
It seems to me more the kind of problem that happen when you change your node version without rebuilding node_modules directory.
If you always install modules with --save modifier, try this:
rm -rf node_modules
npm install
...if not, you can make a backup of your node_modules first. But it will be useful only to inspect it to figure out what modules are missing in your 'package.json' file.

Ionic build not reflecting changes when running or deploying to app

I am using the standard ionic template project that is generated from by WebStorm.
When I make simple changes (like adding a test alert(...)) in app.run(...) in app.js and run the following set of commands, the changes are not reflected when the app runs or is deployed to the phone.
The following commands are ran from the root of my project.
gulp
ionic build android
ionic run|emulate android
Is there something I am missing that would not reflect the changes I am making?
Recently experienced this issue. What helped me is removing the android platform:
ionic platform rm android
then, re-adding it.
ionic platform add android
make sure you delete the app from your device before running/installing again, then run:
ionic run android
hope this helps
So I was able to determine why this issue was occurring.
As I was testing on my android phone (Galaxy to be specific), everytime I would run the following command...
ionic run android
It would appear to deploy/install to my device, and it would open up the app. Howevever, it wasn't actually deploying the newest version as I was already running the previous version in the background.
The fix for this was to make sure that the application was not running (in foreground or background). This required me to make sure that if it was running, that I stop it before testing any changes.
Faced the same issue after upgrading cordova and ionic to the latest versions.
ionic info
Downgraded cordova and ionic versions to match my previous environment, it started taking the changes all over again.
commands:
npm install -g cordova#6.2.0
npm -d install -g ionic#2.0.0-beta.35
Everything works well with the following combination for me.
Hope this helps someone!!!
Just remove all files inside www folder and run ionic lab to update then, for some reason when I run cordova run android the version deployed was the old one, but when I remove the files in www folder the new version was deployed.

Resources