How to have two versions of Nativescript co-exist? - nativescript

Can I have two versions of Nativescript co-exist.
Switch between pre 7 and 7+
Thanks.

You can use npx to run multiple versions of nativescript. You should have it by default if you are running node 5.2 or higher. To run different versions of nativescript apart from the one that is globally installed, you can run the following commands:
// to create a new project with nativescript v6.5
npx nativescript#6.5 create newproject
// to run with nativescript v6.5
npx nativescript#6.5 run ios
And to use the globally installed nativescript cli, you can continue using the regular nativescript cli commands (without npx) - ns run ios/ns create newproject

Related

We no longer support global installation of Create React App

can anyone explain what is this as far as I know I had installed sanity and nodemon globally they are also not allowed ?
PS C:\Users\Rupesh Gupta\Documents\GitHub\PinShare\pinshare_frontend> npx create-react-app#next --scripts-version=#next --template=cra-template#next ./
You are running create-react-app 5.0.0-next.60+6a3315b7, which is behind the latest release (5.0.0).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
npm uninstall -g create-react-app
yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
PS C:\Users\Rupesh Gupta\Documents\GitHub\PinShare\pinshare_frontend>
I had the same issue on that project. I solved it by running
npx clear-npx-cache
and then
npx create-react-app#latest ./ --use-npm
"./" if you're already in the folder you wanted to CRA into, or "your-project-name" if you're not.

How to update nativescript cli

Nativescript 5 is out and I am trying to update the tns version. Currently it tns --version shows as 4.3.2.
I followed all the steps in https://docs.nativescript.org/releases/upgrade-instructions but it still gives me the version as 4.3.2.
How can I upgrade nativescript-cli so that tns --version shows me the latest version.
I did following to reflect the update Nativescript cli. You should only follow this when npm install -g nativescript#latest doesn't reflect update the cli. You can check that using tns --version before and after.
Uninstall current nativescript cli using npm uninstall -g nativescript
Delete the existing tns command manuall if it still exist on your machine.
Install the latest Nativescript cli using npm install -g nativescript#latest
tns --version should now show the latest version.
How I did update tns:
run cmd as administrator (you using windows as i read above in one of comments)
(optional) run npm view nativescript version to check latest aveilable on npm
run tns install -g nativescript
restart cmd
run tns --version - hopefully you will see 5.0.0
hope this helps.
Btw, you might need to run some additional commands for your projects if you already added platforms
tns platform remove {platform}
tns platform add {platform}, where {platform} is android or ios
...also, you might run tns doctor after upgrading as I noticed it broke my other components like choco.

trying to install Polymer 2 CLI

I am trying to run a web app using Polymer. I recently installed Bower & Polymer CLI via Bower – however, whenever I attempt to run 'polymer serve' I receive the message '-bash: polymer: command not found' on Terminal.
Any tips on how I can get this working?
Thanks.
You should update the polymer-cli then create a project using polymer init, use polymer 3.0 app which use npm instead of bower the run polymer serve
This is usually due to an old version of node. I suggest you update node, as well as npm and git. Try installing polymer-cli again with the new node. Then you should be able to run polymer command.
This generally happens when the module is not installed or configured properly or an outdated version. Install or update the required module i.e, polymer-cli. After installing open new terminal or restart terminal and run polymer serve command.

NativeScript Sidekick won't run since CLI 3.2.1 update doesn't work

I opened NativeScript Sidekick on my Mac and it updated to the latest version 0.2.5.
It shows a dialog stating I need to update NativeScript CLI to 3.2.1 and the only option is to quit.
I went to Terminal and tried tns update but it won't update to 3.2.1 saying the platforms for 3.2.1 are not available. (I posted to the NativeScript forums and was told that is correct -- the platforms are at 3.2.0 while only the CLI is updated to 3.2.1.)
I also tried tns update 3.2.1 which simply says 3.2.1 platforms are not available.
tns doctor says 3.2.1 update is available.
NativeScript CLI version is 3.2.0
npm version is 5.4.1
node version is 6.11.3
I've tried creating a new project and it gives me the same issues.
How can I update to NativeScript CLI 3.2.1 so that I can run NativeScript Sidekick?
Solved over on https://discourse.nativescript.org/t/tns-update-3-2-1-not-working/2766/5
the command tns update will update your project, not CLI. If you want to update CLI do:
npm uninstall -g nativescript
npm clear cache
npm install -g nativescript
The command ths update is currently not working, we’ll investigate.
If you are using nvm to manage your NodeJS versions you can try to set the default version to the one that has installed NativeScript CLI. For example if you have NativeScript CLI on NodeJS version 8.9.2, execute:
nvm alias default 8.9.2
To check the packages installed on your active NodeJS version, execute:
npm list -g --depth 0

How can I set up a mean stack app with mean.io which uses angular 1.4 and bower?

I want to code an app in angular 1.4 and for that I came across mean.io the best scaffolding tool presently.But when i downloaded it,i got webpack and tons of various unfamiliar stuff.Please tell me how i can download a mean.io app which uses angular 1.4 or if not then a nice scaffolding tool for angular 1.4 and steps to install it.That would be a great help !
Thanks in advance.
What you can do is head over to the Github page for the mean.io framekwork at this link Mean.io Github version 0.7.0. From there take a look at the read me and scroll follow the instructions.
You'll need to install mongo database on your machine and make sure its running each time you want to run your application. Here is a good link, follow it step by step. MongoDB install - windows
Then you will have to have the latest version of node.js installed. It can be installed here. node js download
You will also need to install the latest version of Git to your machine. It can be installed here Git download
Once the above are done, you will need to navigate to a directory on your computer using the command prompt/terminal and type the following commands. I suggest you go to C:\Users\YourName
npm install -g npm
npm update -g
npm install -g mean-cli
npm install -g bower
They will take some time so be patient.
Then type this command to clone the boilerplate code to your machine
mean init <yourAppTitle>
When that is done change directories into the project folder you just made like this
cd yourAppTitle
Then inside this folder type the following commands to install to your project
npm install
bower install
You may see some warning signs/errors and you can ignore them for now and proceed.
Finally, type this command inside your project folder - this will start your app. Remember to have mongodb running simultaneously or this will not work
gulp
Head over to your browser and type in localhost:3000
You should see the boilerplate code.
If you cannot get Mean.io working you can try installing a different angular scaffold here - angular scaffold. Read through the readme file and you will see steps to install the angular scaffold

Resources