How to revert to NS from 4.1 to 4.0.2 on Mac


#1

I’m trying to revert from NS 4.1.0 to 4.0.2 on Mac due to incompatibilities with the nativescript-google-maps-sdk plugin (see https://github.com/dapriett/nativescript-google-maps-sdk/issues/287). I’ve followed the upgrade instructions, but no matter what I do now tns --version always shows a version of 3.4.0.

Here’s what I’ve tried:

sudo npm uninstall -g nativescript
sudo npm uninstall nativescript
sudo npm install -g nativescript@4.0.2
sudo npm uninstall -g nativescript 
sudo npm install -g nativescript

I can’t say for sure how I originally installed NS, may have been via brew. I’d really appreciate any pointers. I have decades of system experience on Windows, almost zilch on Mac, so this is particularly frustrating.


#2

Hi,
I’m using N 4.1 and google maps works well for me. Do you have a complex code for this, or part of the code that you think is not compatibile ?


#3

What does sudo tns --version say? Could be you’ve installed an updated tns for the root user, but a different version for your own (“non-sudo”) user. Generally try to avoid using sudo at all when installing stuff to avoid these types of trouble.


#4

@Eddy - thanks for your reply; you got me going in the right direction.

Yes, to avoid EACCESS errors I was encountering, I had originally run

sudo npm install -g nativescript

So, I ran

sudo npm uninstall -g nativescript

which removed nativescript from my system entirely. That is both of these commands were undefined:

sudo tns --version
tns --version

I tried running npm install -g nativescript to get the latest version, but again ran into EACCESS errors. GitHub suggested:

sudo chown -R (whoami) /usr/local/lib/node_modules

Which then allowed the install to run without requiring sudo.

So, at least now I can manage the system.