4

私は NativeScript を初めて使用し、現在、ここ ( http://docs.nativescript.org/angular/tutorial/ng-chapter-1 ) で説明されているインストール手順を実行しており、PowerShell スクリプトの実行を完了しました。

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

そして、私は走ります

tns doctor 

そして私は得る

 C:\>tns doctor 'tns' is not recognized as an internal or external command, operable program or batch file.
4

4 に答える 4

0

C:\Users\\username\AppData\Roaming\npm\node_modules(適切に置き換えて)に移動しusername、Nativescript がインストールされているかどうかを確認します。ディレクトリを作成してnativescriptをインストールしない場合は、node_modulesからnativescriptディレクトリをコピーして内部に貼り付けますC:\Users\username\AppData\Roaming\npm\node_modules

C:\Users\username\AppData\Roaming\npm\ tns.cmdファイルを作成し、以下の内容をコピーします

@IF EXIST "%~dp0\node.exe" (
    "%~dp0\node.exe" "%~dp0\node_modules\nativescript\bin\tns" %*
) ELSE (
    @SETLOCAL
    @SET PATHEXT=%PATHEXT:;.JS;=;%
    node "%~dp0\node_modules\nativescript\bin\tns" %*
)
于 2017-11-20T08:02:26.043 に答える
0

ネイティブスクリプトを使用してAngularでモバイルアプリを作成し、Angularモジュールをインストールしようとしていましたnpm install --global @nativescript/schematics

https://blog.angular.io/apps-that-work-natively-on-the-web-and-mobile-9b26852495e7に記載されているすべての指示に従いました

結局、同じエラーに直面しました。

'tns' は、内部コマンドまたは外部コマンド、操作可能なプログラムまたはバッチ ファイルとして認識されません。

しかし、nativescript モジュールをグローバルにインストールすることで解決しました。

npm install --global nativescript

また

npm install -g nativescript

その後、tnsをちゃんと使えるようになりました。

これが問題の解決に役立つことを願っています。

于 2020-05-09T17:42:30.917 に答える