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

tns command not found on mac #1191

Closed
svc76 opened this issue Nov 14, 2015 · 15 comments
Closed

tns command not found on mac #1191

svc76 opened this issue Nov 14, 2015 · 15 comments

Comments

@svc76
Copy link

svc76 commented Nov 14, 2015

Pardon my ignorance here folks. I'm new to mac world.

I have followed every step possible as per https://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html

node -v says v4.2.1
android_home environment variable is set to /usr/local/Cellar/android-sdk/24.4.1

i have tried to install nativescript using sudo and without sudo.

But irrespective of what i do, i can't get to do tns doctor. all i get is tns command not found.

@svc76
Copy link
Author

svc76 commented Nov 14, 2015

I solved it myself after completely uninstalling node/npm, reinstalled node 4.2.2 from node js site, reinstalled nativescript. Now all looks set for my first prototype app. Phew... for a first impression, this is hard.

@ligaz
Copy link

ligaz commented Nov 16, 2015

Thanks for this feedback. We are currently in the process of strengthening our getting started experience and one of the major pain points we are going to address is Node.js installation issues. Starting with 1.5 version of NativeScript we will have a black list of version of Node that are incompatible with the CLI. If you had such an incompatible version we will stop you from executing any command in the CLI and guide you into installing a greener version.

@svc76
Copy link
Author

svc76 commented Nov 20, 2015

Thank you very much. I appreciate taking my feedback in.

@donaldking
Copy link

Still cant get tns command to work! - command not found. Node version 4.3.1. Any fix yet?

@rosen-vladimirov
Copy link
Contributor

@donaldking , this issue had been resolved a while ago. Are you using nvm?
Can you try installing nativescript-cli and send us the output
npm i -g nativescript > out.txt

@donaldking
Copy link

@rosen-vladimirov Thanks for the quick response. Its working now! :)

@geyang
Copy link

geyang commented Mar 5, 2016

I had the same problem. The problem on mac is that

The correct bash profile file should be ~/.profile. However, tns ended up adding the path to ~/.bashrc.

@geyang
Copy link

geyang commented Mar 5, 2016

To make matter even worse, as soon as tns adds the .bashrc and .bash_profile file, both iTerm and terminal start to read these by default, and all of the configurations in .profile are not sourced.

@jaferret
Copy link

jaferret commented May 18, 2016

out.txt

Ok so whats the solution? Any commands I need to execute? I'm having the same issue... How do I fix this?

@bgillock
Copy link

bgillock commented Feb 8, 2017

I fixed this on my mac by adding:
export PATH=$PATH:~/.npm-packages/bin
to my ~/.bashrc

@UtsavPreet
Copy link

I fixed this by manually coping the nativescript folder from my local node_modules folder to this location :-
/usr/local/Cellar/node@8/8.9.4/lib/node_modules/
then just added a path in .bash_profile file

PATH=$PATH:/usr/local/Cellar/node@8/8.9.4/lib/node_modules/nativescript/bin

I used Homebrew to install node so that is the reason for node@8 folder in my root

Hope this helps everyone who have been facing this issue

@buitanan
Copy link

i ran this command in root

if you don't know password root: use this command to reset:

sudo passwd root
then type new password
npm install -g nativescript@latest
Enter
exit
Reopen Sidekick

@fcallegari7
Copy link

I fixed that by exporting the PATH on the terminal.
Just run:
export PATH=$PATH:~/node_modules/nativescript/bin

@getcodenow
Copy link

getcodenow commented Jul 5, 2020

I encountered this issue just now. The solution for me was to change my default shell from zsh to bash. When I upgraded my mac to macOS Catalina is changed the default shell to zsh. By going to the terminal and running the following command:
chsh -s /bin/bash

After running this command I was able to reset my shell to bash and the tns command ran with no other changes required.

@mudlabs
Copy link

mudlabs commented Nov 1, 2020

@getcodenow that's the same issue I'm having. But it would be good to have a solution that worked with zsh

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