{"id":1004,"date":"2019-07-17T16:20:32","date_gmt":"2019-07-17T16:20:32","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=1004"},"modified":"2019-07-17T16:20:35","modified_gmt":"2019-07-17T16:20:35","slug":"running-nativescript-5-4-and-nativescript-6-0-side-by-side","status":"publish","type":"post","link":"https:\/\/fluentreports.com\/blog\/?p=1004","title":{"rendered":"Running NativeScript 5.4 and NativeScript 6.0 side-by-side."},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"blob:http:\/\/fluentreports.com\/8a84a53f-9573-4baf-adf7-50d0ef528c5a\" alt=\"\" width=\"324\" height=\"323\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">For those who have been hiding in the hills for a while; you may not have noticed that the cool news for NativeScript is that we have a new version that has been coming for a while.  6.0 was officially released today! <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well 6.0 has been release; and there are a lot of things to like in 6.0, but if 6.0 doesn't work for your app; you might still need to run 5.4 to get your work done.   Unfortunately, the NativeScript team did not listen to my advice and release a 5.5 to continue testing the new webpack only builds, so we now have a 6.0 with still a lot of webpack issues and now no easy work around because legacy mode was removed in 6.0.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of the techniques, I used while testing 6.0RC on plugins and apps and reporting the massive number of issues I ran into; is making my install side-by-side.   So now I have a <code>tns5<\/code> command which is my tns 5.4.2 install.  And then <code>tns<\/code> is my 6.0 release.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"458\" height=\"68\" src=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-4.png\" alt=\"\" class=\"wp-image-1008\" srcset=\"https:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-4.png 458w, https:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-4-300x45.png 300w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The first step to run a side-by-side install is to do a <code>npm i -g nativescript@5.4.2<\/code> to install 5.4.2 (the last 5.4 version) on your machine in the global node_modules.     Now depending on the OS; this directory will be in a couple places:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The easiest way to find out where it is stored is to run the following command in your command or terminal shell: <strong>npm root -g<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Under most linux installs this folder is here:<br>- <strong>\/usr\/local\/lib\/node_modules<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Under Mac OSX the folder can be in a couple places, depending on how you installed it.<br>For example because I run <code>nvm<\/code> on my mac, my folder is located here:<br><strong>\/Users\/nathanael\/.nvm\/versions\/node\/v10.15.3\/lib\/node_modules<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And on windows 10, it is located typically here:<br><strong>%USERPROFILE%\\AppData\\Roaming\\npm\\node_modules<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But using the <code>npm root -g<\/code> will tell you exactly where it is on your machine.    <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So first navigate to this folder and find the \"nativescript\" folder; and then copy it in its entirety to the \"nativescript5\" folder.  This gives you a fully working NS 5.4.2 version in a different folder that won't be overwritten when you do the <code>npm i -g nativescript@latest<\/code> which will give you the NS 6.x version.   <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"267\" height=\"136\" src=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-1.png\" alt=\"\" class=\"wp-image-1005\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The final piece of this puzzle is creating the <code>tns5<\/code> command, on my mac the folder for where to put it is:<br><strong>~\/.nvm\/versions\/node\/v10.15.3\/bin<\/strong> <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"323\" height=\"44\" src=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-2.png\" alt=\"\" class=\"wp-image-1006\" srcset=\"https:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-2.png 323w, https:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/07\/image-2-300x41.png 300w\" sizes=\"auto, (max-width: 323px) 100vw, 323px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"text-align:left\">So I created the <code>tns5<\/code> symlink to point to <code>..\/lib\/node_modules\/nativescript5\/bin\/tns<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Linux we needed to create the symlink in <strong>\/usr\/local\/bin<\/strong>; and so I created the <code>tns5<\/code> symlink to <strong>..\/lib\/node_modules\/nativescript5\/bin\/tns<\/strong> (the exact same relative path as mac)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>npm i -g nativescript@5.4.2<\/code><\/li><li><code>npm root -g<\/code><\/li><li>cd (folder listed from npm root -g command)<\/li><li>copy nativescript to nativescript5<\/li><li><code>npm i -g nativescript@latest<\/code><\/li><li>create a <code>tns5<\/code> symlink<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This should allow you to have a permanent install of v5.4.2 and then your normal update-able version .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For those who have been hiding in the hills for a while; you may not have noticed that the cool news for NativeScript is that we have a new version that has been coming for a while. 6.0 was officially released today! Well 6.0 has been release; and there are a lot of things to&hellip; <a class=\"more-link\" href=\"https:\/\/fluentreports.com\/blog\/?p=1004\">Continue reading <span class=\"screen-reader-text\">Running NativeScript 5.4 and NativeScript 6.0 side-by-side.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1009,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15],"tags":[144,16,143,60],"class_list":["post-1004","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nativescript","tag-install","tag-nativescript","tag-side-by-side","tag-upgrade","entry"],"_links":{"self":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1004"}],"version-history":[{"count":1,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1004\/revisions"}],"predecessor-version":[{"id":1010,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1004\/revisions\/1010"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/1009"}],"wp:attachment":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}