IOS版本中的nativescript 5.1和tns_modules文件夹 [英] nativescript 5.1 and tns_modules folder in IOS build

查看:127
本文介绍了IOS版本中的nativescript 5.1和tns_modules文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在某些应用程序中遇到过此问题(N 4.1). 现在我正在做另一个应用程序,并且我遇到了同样的问题: 首先,我正在准备构建:

I had this issue before with some app (N 4.1). Now i'm doing another app, and i have the same issue : First, im preparing build:

tns build ios --for-device --release --provision MY_Provision

Nativescript正在构建,所以接下来我要在XCode中打开它,并做一些改动,例如版本号等. 最后,我正在执行存档"并尝试验证此存档. 结果是错误,在以前用N 4.1编写的应用程序中,我具有相同的功能,但带有另一个插件,现在验证抛出:无效的构建结构-二进制app/rns_modules.fstevents.lib/binding/Release/FILE NAME. 有关此文件夹的许多错误. 因此,我刚刚删除了该目录,并进行了另一个归档和验证-应用程序通过了验证.

Nativescript is doing build, so next i'm opening it in XCode, and doing some twaks like version number etc... Lastly i'm doing "Archieve" and trying to Validate this archieve. The result is error, in the previous app written in N 4.1 i had the same but with another plugin, and now validation throws: Invalid build structure - binary app/rns_modules.fstevents.lib/binding/Release/FILE NAME. many errors regarding this folder. So i've just removed this directory and done another archieve and validation - app passed the validation.

所以,我的问题是-我在tns_modules中需要这么多的插件吗? 还是更好的问题-有什么方法可以确定不需要什么? 或者,在构建应用程序时我做错了什么?似乎这里有大量的目录,我想知道是否有某种清理或其他方法?

So, my question is - do i need such number of plugins in tns_modules ? Or better question - is there any way to determine what is not needed ? Or, am i doing something wrong when building an app ? As seems massive number of directories here and i'm wondering if maybe there is some kind of cleanup or something ?

目前,存储应用程序的唯一方法是先进行验证,检查阻止验证的内容,然后删除它,然后检查应用程序是否有效(:(),然后重试. 谢谢.

For now, the only way to store an app is to validate first, check what is blocking validation, delete this, check if app works (:() and try again. Thank you.

下方的附件文件夹阻止了tns_modules内部的验证和目录数量.

Below, attached, folder that is blocking validation and amount of dirs inside of tns_modules.

pacakge.json:

pacakge.json:

推荐答案

NativeScript CLI将在tns_modules中准备(即复制)在package.json的dependencies部分声明的所有程序包(及其依赖项).所有devDependencies及其依赖项都不会复制到本机Xcode/Android Studio项目中. 因此,仅用于构建应用程序所需的所有软件包都应安装为devDependencies.例如,这样的软件包是nativescript-dev-webpacknativescript-dev-typescript等. 同样,您似乎已将NativeScript CLI安装为项目的依赖项.默认情况下,应全局安装它,即npm i -g nativescript.如果您省略-g标志,npm会将其安装为您项目的依赖项. 您可以尝试:

NativeScript CLI will prepare (i.e. copy) all packages declared in the dependencies section of your package.json (and their dependencies) in tns_modules. All devDependencies and their dependencies will not be copied to the native Xcode/Android Studio project. So, all packages that are required only for building the application, should be installed as devDependencies. For example, such packages are nativescript-dev-webpack, nativescript-dev-typescript, etc. Also, it looks like you have installed NativeScript CLI as a dependency of your project. By default, it should be installed globally, i.e. npm i -g nativescript. In case you omit the -g flag, npm will install it as dependency of your project. You can try:

rm -rf platforms
npm un --save nativescript

在package.json中检查名称中带有-dev的其他软件包,并确保它们位于devDependencies部分中.

Check package.json for other packages with -dev in their names and ensure they are in the devDependencies section.

然后运行tns build ios --forDevice.

这篇关于IOS版本中的nativescript 5.1和tns_modules文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆