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.
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.
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.
Thank you very much. I appreciate taking my feedback in.
Still cant get tns command to work! - command not found. Node version 4.3.1. Any fix yet?
@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
@rosen-vladimirov Thanks for the quick response. Its working now! :)
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.
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.
Ok so whats the solution? Any commands I need to execute? I'm having the same issue... How do I fix this?
I fixed this on my mac by adding:
export PATH=$PATH:~/.npm-packages/bin
to my ~/.bashrc
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
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
I fixed that by exporting the PATH on the terminal.
Just run:
export PATH=$PATH:~/node_modules/nativescript/bin
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.
@getcodenow that's the same issue I'm having. But it would be good to have a solution that worked with zsh
Most helpful comment
I fixed this on my mac by adding:
export PATH=$PATH:~/.npm-packages/bin
to my ~/.bashrc