How to completely uninstall Cordova - node.js

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.

Related

node.js is not installed android studio gradle

guys,
I found the answer
node-js-is-not-installed
and I have the same problem
actually, I have nodejs
sudo apt-get install nodejs
Reading state information... Done
nodejs is already the newest version (8.10.0~dfsg-2ubuntu0.4)
.
but if I try to build I coach Gradle exception like
Node.js is not installed. Visit https://nodejs.org/en/download/ to install it.
Open File
unfortunately, steps by issues/3745 don't resolve it fo me
enter image description here
any help would be appreciated.
I had a identical problem earlier today. But I'm on a Mac. Same behaviour as you experienced.
I've try to reinstall node, and several rebuilding of my project but none of those worked.
In the end, I started over. Seems that the installation of the amplify cli did not went throught the previous time.
npm install -g #aws-amplify/cli
But I've come to another problem with the manifest.xml right after that. I think both are related...
And adding this to my manifest did the job : 'tools:replace="android:name"' (for reference if this problem follow : https://github.com/aws-amplify/amplify-android/issues/532 )
Run this in your project directory and then resync:
npx amplify-app --platform android
At least, this helped me
Did you install amplify using sudo? That has solved my problem.
Also using Mac OSX
Looks like you may not have proper write permissions on node_modules folder, use chmod 777 your_node_module_folder

Uninstalling Cordova and Ionic not working

I am trying to uninstall Cordova and Ionic from my mac. I have run sudo npm uninstall ionic cordova and also with -g however when I run cordova --version or ionic --versions it keeps coming back with version numbers and it all still works normally.
I have checked the directories of both local and global npm install locations and the folders aren't there, when I run the command after the first time it throws an error that it can't find the folders.
I have gone so far as to completely remove NodeJS from my machine but to no avail. Where else is cordova and ionic installed? How do I completely remove them from my machine?
So for some reason, npm uninstall does not deal with the files in the opt directory, found the rougue folders and removed. Problem solved.

Appcelerator Unable to locate cli executable

I am using OSX El Capitain and have just downloaded Appcelerator Studio. After the installation I tried to run it and when I try to log in I receive this error message: Unable to locate CLI executable (print screen below). I have already installed NodeJs downloaded directly from Appcelerator website.
How could I solve this?
There could have been an issue installing the the CLI depending on permissions. Appcelerator Studio installs node (if required), appcelerator CLI, Titanium CLI and others into a package underneath the AppceleratorStudio.app package. This is to ensure that it has those available.
I would recommend checking your permissions and potentially re-installing Appcelerator Studio from the link :
web.appcelerator.com
Additionally you could install the CLI's globally using the following commands:
sudo npm i -g appcelerator
sudo npm i -g titanium
sudo npm i -g alloy
Once they are installed, see about running studio again to see if you still have issues.
Maybe your CLI is not be installed properly that's why you get this error. So try to install the CLI manually through the terminal respectively
sudo npm install -g appcelerator
appc use latest
appc setup
sudo npm install -g alloy
Here's the documents link -
https://web.appcelerator.com/product/cli
Then open the studio. Hope this helps.
Regards,
Appcelerator support.
Apart from the reason given by #bert-g, it might also because an old version of node (i.e. node 0.10) was installed instead of 0.12.
I was using nvm for node version control. When starting the app from application icon, it stuck at the same screenshot. Therefore I have tried to start the app from console (i.e. /Applications........./AppceleratorStudio) and it complains my node version should be 0.12. Used nvm install 0.12 and run from console again, it works!
So whenever dev tools have problems with CLI things, the first thing I do is reinstall Xcode. Fixed everything almost every time.
This should unlink the libraries, uninstall, and remove Xcode
Go to Terminal and run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo rm -rif ~/Applications/Xcode.app
Then go to the App Store and reinstall Xcode
Do make sure you are up to date, install the CLI tools from HERE
You need both Xcode and the CLI tools. I am not sure if the CLI tools are downloaded with Xcode so make sure by downloading both.
Please let me know if this works!
Update: Must have Appcelerator CLI installed and configured as well

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.

Cordova inAppBrowser plugin issue on windows

so I've been trying to add this plugin with command
cordova plugin add
https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
which worked on MAC and Linux after
npm update -g cordova
but on windows I'm still getting
cannot read property 'install' of undefined
Moreover - when I'm trying to uninstall ( cordova plugin rm org.apache.cordova.inappbrowser ) then I'm getting
cannot read property 'uninstall' of undefined
Weird thing is that I have two cordova folders - one in
C:\Users\me\AppData\Roaming\npm\node_modules and the second one in
C:\Users\me\AppData\Roaming\npm\node_modules\phonegap\node_modules . Path which I added to my environmental variables is C:\Users\mati\AppData\Roaming\npm\node_modules\phonegap\node_modules\.bin
I think that this is the problem reported about a week ago as CB-6008 on the Cordova bug tracker.
It may be a symptom of having an out-of-date cordova installation still. The issue there was solved by removing and reinstalling Cordova to ensure that the latest version was in use.
Delete the content of your platforms and plugins folder. re-install your plugins and the problem should be gone. In my case the following command
phonegap local plugin add org.apache.cordova.inappbrowser
produced -> [error] Cannot read property 'install' of undefined
and the above procedure fixed it.
Have you added a platform to your cordova project (before trying to add a plugin)?
npm update -g cordova
cordova create myproject
cd myproject
cordova platform add android
cordova plugin add _
I think the undefined error means a dependency of the add plugin command is not there.
For me, the solution was to update plugman module:
npm install -g plugman

Resources