微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在终端“ tns Preview”命令中不起作用 NativeScript

如何解决在终端“ tns Preview”命令中不起作用 NativeScript

我想在本地运行NS应用程序。我从play.nativescript.org下载了项目,并用目标路径打开了cmd,然后按照以下步骤操作

步骤1.安装最新的NativeScript CLI

在命令提示符或终端中键入以下命令。

npm install -g nativescript@latest

并且我已经成功安装了NativeScript CLI

第2步。预览您的应用

导航到您的项目文件夹并运行以下命令以启动 预览您的应用。

tns preview

输入命令时出现此错误

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 bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.0: request has been deprecated,see https://github.com/request/request/issues/3142
npm WARN deprecated core-js@2.6.11: 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 har-validator@5.1.5: this library is no longer supported
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and Could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: 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

解决方法

就像github.com中的 therosko 所写的那样,使kinvey-nativescript-sdk的版本为5.0.1对我有用。 Src:enter link description here

,

不幸的是,play.nativescript.org导出的项目无法在nativescript版本7和更高版本上运行。

当前,唯一的解决方案是使用npm install -g nativescript@6.8.0

安装{N} CLI

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。