Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'tns' is not recognized as an internal or external command, operable program or batch file. NativeScript

I am new to NativeScript and am currently going through the installation steps described here (http://docs.nativescript.org/angular/tutorial/ng-chapter-1) and I just completed executing the PowerShell script

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"

and then I run

tns doctor 

and I get

 C:\>tns doctor 'tns' is not recognized as an internal or external command, operable program or batch file.
like image 941
Robert Green MBA Avatar asked Dec 01 '22 16:12

Robert Green MBA


2 Answers

Use this code

npm install --global nativescript

I had the same isssue and installing nativescript solved it.

like image 79
Hüseyin Sekmenoğlu Avatar answered Dec 03 '22 04:12

Hüseyin Sekmenoğlu


If you are on Windows you need to add the the npm global directory to your path.

  1. Control Panels -> System
  2. Advanced System Settings (Link on Left side)
  3. Environmental Variables (Button)
  4. Scroll down for Path, and then click Edit (Button)
  5. Append to the end: ;%USERPROFILE%\AppData\Roaming\npm

Make sure you get the semicolon.

This should work on Windows 7. I can get you the steps for other versions of windows; but hopefully this gets you going.

like image 40
Dileep Avatar answered Dec 03 '22 04:12

Dileep