NativeScript 版本 8.2.1:如何使用旧的过时插件

发布于 2025-01-13 19:28:20 字数 1084 浏览 0 评论 0原文

我是 NativeScript 和 Webpack 的新手,我已将本机脚本应用程序从 6.5.1 迁移到 8.2 版本,并且我正在使用 nativescript-orientation-free 插件,我收到构建错误,因为该插件仍然引用 Native 中不再支持的 tns-core-modules脚本 8 和我收到以下错误

8,我在 ./node_modules/nativescript-orientation-free/orientation.js 17:12-48 中 ERROR 找不到模块:错误:无法解析“/Users/admin/Development/project/node_modules/nativescript-orientation-free”中的“tns-core-modules/ui/enums”

错误。/node_modules/nativescript-orientation-免费/orientation.js 18:12-48 找不到模块:错误:无法解析“/Users/admin/Development/project/node_modules/nativescript-orientation-free”中的“tns-core-modules/ui/frame”,

我们不想使用此付费版本< a href="https://npm.proplugins.org/-/web/detail/@proplugins/nativescript-orientation" rel="nofollow noreferrer">pro-plugins-nativescript-orientation

orientation.js

您能让我知道如何解决此问题吗?我可以在 webpack.config.js 中做什么?我被困在这里了。

I am new to NativeScript and Webpack and i have migrated my native script app from 6.5.1 to 8.2 version, and i am using nativescript-orientation-free plugin ,i am getting build errors as this plugin still refers to tns-core-modules which is no longer supported in Native Script 8 and i am getting below errors

ERROR in ./node_modules/nativescript-orientation-free/orientation.js 17:12-48
Module not found: Error: Can't resolve 'tns-core-modules/ui/enums' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'

ERROR in ./node_modules/nativescript-orientation-free/orientation.js 18:12-48
Module not found: Error: Can't resolve 'tns-core-modules/ui/frame' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'

we do not want to use this paid version pro-plugins-nativescript-orientation

orientation.js

can you please let me know how can i fix this issue? is there anything i can do in the webpack.config.js ? I am stuck here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨轻弹 2025-01-20 19:28:20

我对你表示同情。 (引用自电影《异形》。)

由于所有重大更改,将 NativeScript 应用程序从 6.5 迁移到 8.x 可能会非常令人沮丧。请务必观看此视频:将旧版 NativeScript 6 项目迁移到 8

当迁移我的应用程序时,我发现我必须迁移我使用的几个插件。 Patch-package 是你的朋友!要回答您的问题,您需要修改圈出的链接。有时这很容易,有时这需要调查。

这三个应该可以工作:

import { Application as application } from '@nativescript/core';
const Enums = require("@nativescript/core/core-types").Enums;
import { Frame as frame } from '@nativescript/core';

我希望这两个应该可以工作,尽管我没有在我的项目中使用它们:

import { Page } from '@nativescript/core';
import { View as view } from '@nativescript/core';

祝你好运!

You have my sympathies. (A quote from the movie Alien.)

Migrating a NativeScript app from 6.5 to 8.x can be wildly frustrating due to all the breaking changes. Make sure you watch this video: Migrating Legacy NativeScript 6 Project to 8.

When Migrating my app I found I had to migrate several of the plugins I used. Patch-package is your friend! To answer your question, you'll need to revise the links you circled. Sometimes this is easy, sometimes this requires investigation.

These three should work:

import { Application as application } from '@nativescript/core';
const Enums = require("@nativescript/core/core-types").Enums;
import { Frame as frame } from '@nativescript/core';

I expect these two should work, 'tho I didn't use them in my project:

import { Page } from '@nativescript/core';
import { View as view } from '@nativescript/core';

Good luck!

玉环 2025-01-20 19:28:20

我删除了这个插件,并且能够在没有任何第三方插件的情况下设置方向

UIDevice.currentDevice.setValueForKey(1, "orientation");

i removed this plugin and able to set the orientation without any third party plugins using

UIDevice.currentDevice.setValueForKey(1, "orientation");

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文