In terminal 'tns preview' command not working. (NativeScript)

886 views Asked by At

I wanted to run my NS application in local. I downloaded project from play.nativescript.org, And I open cmd with target path and I followed this steps

Step 1. Install the latest NativeScript CLI

Type the following command in a Command Prompt or Terminal.

npm install -g nativescript@latest

and I have successfully installed the NativeScript CLI

Step 2. Preview your app

Navigate to your project folder and run the following command to start previewing your app.

tns preview

When I entered the command I get this errors

You are using the deprecated nsconfig.json file. Just be aware that NativeScript 7 has an improved nativescript.config.(js|ts) file for when you're ready to upgrade this project.
npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://github.com/thomasconner/javascript/tarball/67b7944366453a87226389d483ac1ad861e0e129npm ERR! 404
npm ERR! 404  'pubnub@https://github.com/thomasconner/javascript/tarball/67b7944366453a87226389d483ac1ad861e0e129' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'kinvey-nativescript-sdk'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dotor\AppData\Roaming\npm-cache\_logs\2020-10-01T09_47_56_177Z-debug.log
Command npm.cmd failed with exit code 1
2

There are 2 answers

1
Cem Kaan On

Unfortunately, play.nativescript.org exported projects won't run with nativescript version 7 and up.

Currently, the only solution would be to install {N} CLI using npm install -g [email protected]

2
Khasan 24-7 On

As in github.com therosko has written, making kinvey-nativescript-sdk version as 5.0.1 worked for me. Src: here