This is a migrated thread and some comments may be shown as answers.

Installing NS CLI from master

5 Answers 65 Views
NativeScript Insiders
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Antonio
Top achievements
Rank 1
Antonio asked on 26 Feb 2015, 03:16 PM
Hi all,

I know you are probably super busy for the release of next week, but we are super excited too and looking forward to the announcements of next week:)

I am trying to install the latest release of the nativescript CLI from master, but the installation doesn't complete properly.
The error reports that it can't find nativescript-cli.js module into the node_modules/lib directory, and there is no nativescript-cli.js in lib, but nativescript-cli.ts. I think you switched to typescript for that module, but for some reason the tns script is still looking for the js version.
You can find the complete error stack in the bottom.

How can I test the latest changes from the github repo? 
thank you in advance

module.js:340
    throw err;
          ^
Error: Cannot find module '../lib/nativescript-cli.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/bin/nativescript.js:4:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)



5 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 26 Feb 2015, 03:29 PM

Hi Antonio,

The thing is that the nativescript-cli is written in TypeScript and it needs to get "transpiled" to JavaScript first.

Though you could do that in-place, I would recomment that you create an NPM package first and then install it to your machine. Here are the steps for that:

1) Clone and init submodules of the repo
2) get into the desired branch (e.g. master)
3) run npm install to have all the build dependencies fetched locally
4) install grunt-cli via the command npm install -g grunt-cli
5) run grunt pack to get the source code transpiled and packed
6) install the ready CLI package via npm install -g ./nativescript-XXX-non-ci.tgz

Now you should be able to call the tns create ... command

Kind regards,
Erjan Gavalji
Telerik

 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Antonio
Top achievements
Rank 1
answered on 26 Feb 2015, 05:22 PM
Thank you for the prompt reply, but unfortunately I cannot init the submodule, because it seems I don't have the permissions:

$ git submodule update --init --recursive
Submodule 'lib/common' (git@github.com:telerik/mobile-cli-lib.git) registered for path 'lib/common'
Cloning into 'lib/common'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@github.com:telerik/mobile-cli-lib.git' into submodule path 'lib/common' failed

As a member of the NS insiders, should I be able to have access to it?
thank you
0
Antonio
Top achievements
Rank 1
answered on 26 Feb 2015, 05:22 PM
Thank you for the prompt reply, but unfortunately I cannot init the submodule, because it seems I don't have the permissions:

$ git submodule update --init --recursive
Submodule 'lib/common' (git@github.com:telerik/mobile-cli-lib.git) registered for path 'lib/common'
Cloning into 'lib/common'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@github.com:telerik/mobile-cli-lib.git' into submodule path 'lib/common' failed

As a member of the NS insiders, should I be able to have access to it?
thank you
0
Antonio
Top achievements
Rank 1
answered on 26 Feb 2015, 05:25 PM
please ignore my reply
I used the wrong git command :(

Sorry for that :(
0
Erjan Gavalji
Telerik team
answered on 27 Feb 2015, 06:44 AM
Hi Antonio,

No worries. I hope everything is fine now.

Just to note, as someone else might get into the same problem - we are using the "smart" git protocol (which works with SSH keys). Thus, the submodules are registered as "git://..." entries and the git submodule update --init --recursive command might not succeed.

Cloning the repository via the git protocol (git clone git@github.com:NativeScript/nativescript-cli.git) would ensure you won't have problems with the submodule initialization.

Best,
Erjan Gavalji
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
NativeScript Insiders
Asked by
Antonio
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Antonio
Top achievements
Rank 1
Share this question
or