nativescript cli sidekick with nvm - nativescript

When I use nvm to install a recent version of node, I have to reinstall tns. I can do that with the command npm i -g nativescript#latest. If I check tns --version I get the appropriate version. However, Nativescript Sidekick keeps telling me to run that command and will not launch. Has anyone gotten Nativescript with node to work with nvm?

I figured this out. I had to set the default node version to a lower than current version to work with Nativescript Sidekick.
nvm alias default 10.13.0

Related

`nvm install` command on MacOS ignores some optional flags

I'm using NVM v0.39.2 on MacOS 12.5.1 (21G83) in ZSH 5.9 (x86_64-apple-darwin20.6.0)
I always keep latest LTS version of the Node for global system usage and to achieve this I run next 1-line command to install newer Node version with latest NPM and set it to be new system default:
nvm install v18.12.0 --reinstall-packages-from=v16.18.0 --latest-npm --default
I've noticed some time ago that the packages from previous version are re-installed automatically, but NPM is installed of default version (in most cases it is latest one, but if not, default one is installed) and this new version of Node is not set as default.
I know how to easily install latest NPM and set Node version as default, but want to do this in 1-line command, because these flags are published in NVM help
I've checked the nvm help, but didn't find any directions about the order of flags or anything similar, which could impact on the behavior. Also I've searched for such cases here, but didn't found anything related.
I expect that latest NPM is installed and new version of Node is set as default automatically after execution of the command:
nvm install v18.12.0 --reinstall-packages-from=v16.18.0 --latest-npm --default
While in fact, default version of NPM is installed and new version is not default one

NativeScript Sidekick - CLI is required (version 5.1.1)

I recently got noticed in the Sidekick application on mac OS that a new version of the CLI was released and that I needed to update.
I quit Sidekick and run the "sudo tns i -g nativescript#latest --unsafe-perm" command in terminal with the following results:
+ nativescript#5.1.1
updated 67 packages in 14.325s
When I try to start Sidekick I get the following error:
Sidekick prompt
I head back to terminal and run "tns doctor" with the following results:
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 10.1.0 satisfies minimum required version 9.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 5.1.0 and the latest available version is 5.1.1.
It seems like the update are not recognized by either tns doctor or Sidekick, what should I do to fix this?
Do you have nvm? This can happen when the settings in terminal are different from the global ones. For example it is possible to use one node version in the terminal and other from globally installed Sidekick.
You shouldn't use sudo - see this blog post on details on how to resolve the issue by removing the need for superuser while doing NPM installs. Similar thread here
On tns doctor command we got this message: Getting NativeScript components versions information...
This after tried to update with: sudo npm install nativescript -g --unsafe-perm
after that we got a lot of error messages.
Solved with this simply command:
tns proxy clear
then run: sudo npm install nativescript -g --unsafe-perm
Solved!

Firebase command not found days after having already successfully used it

I am trying to use the 'firebase' command from my Mac terminal to deploy firebase cloud functions using 'firebase deploy --only functions'. I just used this command a week or two ago when I updated my firebase-functions and firebase-tools to version 3.18.4 but now everytime I try to use the 'firebase' keyword to run a command it says -bash: firebase: command not found. When I run npm -g list I see that I have firebase, firebase-tools and more in that list.
I've tried running 'npm install -g firebase-tools` but it still doesn't work. Also I tried what is recommended in this question
but still not working. Any advice would be great, thanks
First I ran npm get prefix which should output something like /Users/username/.npm-packages. Then I had to add the following to my $PATH variable
export PATH="/Users/username/.npm-packages/bin:$PATH"
Note the extra /bin (after the result of npm get prefix)
And I also added
export PATH="/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:~/bin:$PATH$
Then you must activate the changes to your bash_profile by running source ~/.bash_profile
Once I did this the firebase command is again globally recognized
Try the following in your terminal:
curl -sL https://firebase.tools | bash
This will check the OS of your machine and then install everything else automatically and properly.
The command is from the official Firebase Documentation.
I've just fallen into the same issue. My case was in different node versions a) when installing firebase globally, b) when using it during next session. I'm using nvm and my default was node v10, but I installed firebase on node v12. So after restart I got node v10. When I realised it, I switched nvm default from v10 to v12:
$ nvm alias default v12.13.1
And firebase started working.
For those who use yarn instead of npm to manage global packages, yarn seems to place binaries in isolated directory as symbolic links.
In my case, I did yarn bin to look for where binaries are, turned out it is $HOME/.config/yarn/global/node_modules/.bin. So, I set it to .bashrc. Now it's working.

react native is not set up after setting up the PATH variable

I am setting up react native on mac. I have installed node along with npm.
node version is v6.11.4
npm version is 5.4.2
I have install react native, command shown on the below image. And also export the PATH, then also it shows an error that react-native command not found. Could anyone help?
After running npm install -g react-native --verbose, it shows following:
I believe the command to get react-native-cli version is react-native -version which will show CLI version and the version of any react-native project directory you are in
I've seen this very error happening to a colleague of mine back in India. For some reason their ISP restricted the network to a level they couldn't access the NPM registry fully and the only way around it at that time was to use a VPN. Sadly I can't provide you any more info as this happened a couple of years ago.
You may want to change your DNS settings to override your ISPs' to see whether this helps but the reason why installation of react-native-cli is failing is that you can't access the NPM registry so it's a problem with your network provider rather than your machine.

I installed the composer-cli globally but it shows me error

I installed the composer-cli globally but it shows me error
"-bash: composer: command not found" at mac os sierra
Please make sure you did not install using sudo and that you check that the install actually worked. e.g. it will fail if you don't have XCode installed.
Yes to add to the point mentioned above.After installing Xcode it didnt work out for me . So i changed my node version from
11
to
8.8.15
and did npm install -g composer-cli. It worked for me .

Resources