nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

nativescript cli isnt identified after instalation.

Open Betryx opened this issue 3 years ago • 5 comments

Issue Description

when i try running ns <command> as an example ns create patron --js or any other command of the nativescript cli, i get an error message that says ns isnt identified:

Output: ns: The term 'ns' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

outp

Reproduction

No response

Relevant log output (if applicable)

Output:
     `ns: The term 'ns' is not recognized as a name of a cmdlet, function, script file, or executable 
      program.
      Check the spelling of the name, or if a path was included, verify that the path is correct and try 
       again.`

Environment

No response

Please accept these terms

Betryx avatar Jul 31 '22 15:07 Betryx

Make sure you have installed everything as noted in the setup guide

https://docs.nativescript.org/environment-setup.html#windows-android

rigor789 avatar Jul 31 '22 15:07 rigor789

everything is installed as it should be via the guide, but still doesnt work

Betryx avatar Jul 31 '22 15:07 Betryx

Is your npm set up correctly? The global install dir should be in your Environment Variables/Path - can't really give exact steps to fix as it depends on the way you installed nodejs.

rigor789 avatar Jul 31 '22 16:07 rigor789

yes my npm is installed corectly.

Betryx avatar Aug 03 '22 01:08 Betryx

Ok, so npm is good, run npm -g prefix and make sure that path + /bin is in your PATH variable.

For example:

$ npm -g prefix

/Users/rigor789/.nvm/versions/node/v18.3.0

So I have

/Users/rigor789/.nvm/versions/node/v18.3.0/bin

in my PATH.

(my example is from a macos machine, but the only difference would be the actual path).

Once you are certain the path is in your system PATH (environment variable), then restart your terminal to pick up the environment changes, and see if ns -v works.

And just to add, this has nothing to do with ns specifically, it's a standard globally installed node module which you are having trouble with - adding this just to help with your search.

rigor789 avatar Aug 03 '22 15:08 rigor789

Worked for me: https://stackoverflow.com/questions/44958847/message-the-term-ng-is-not-recognized-as-the-name-of-a-cmdlet

anterof5 avatar Sep 13 '22 18:09 anterof5