我正在尝试为iOS构建我的应用,但是我收到了这个错误:
Successfully prepared plugin tns-core-modules for ios.
Processing node_modules failed. TypeError: str.replace is not a function
我不明白为什么这只会在构建iOS时出现(android工作正常)。 我已经尝试添加/删除平台,更新nativescript等。 这是关于运行版本的package.json部分
"nativescript": {
"id": "com.xxxxx.app",
"tns-android": {
"version": "2.4.0"
},
"tns-ios": {
"version": "2.4.0"
}
},
"dependencies": {
"tns-core-modules": "^2.4.0"
},
我的打字稿版本是1.8。
可能是什么原因造成的?
这是我的tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true
},
"exclude": [
"node_modules",
"platforms"
]
}
答案 0 :(得分:0)
也许你错过了参考设置。我一直在使用TypeScript 2+使用NativeScript。请查看此示例应用,也许您将其与您的设置进行比较:https://github.com/TobiasHennig/nativescript-toast/tree/master/samples/angular
答案 1 :(得分:0)
我必须删除import javax.mail._
import javax.mail.internet._
import org.apache.spark.{SparkConf, SparkContext}
object EmailAlert {
def main(args: Array[String]): Unit = {
val sparkConf = new SparkConf().setAppName("E-mail Alert").setMaster("local")
val sc = new SparkContext(sparkConf)
var bodyText = "Test mail"
// Set up the mail object
val properties = System.getProperties
properties.put("mail.smtp.host", "email-smtp.us-east-1.amazonaws.com")
properties.put("mail.smtp.user", "********");
properties.put("mail.smtp.password", "********");
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.port", "587")
properties.put("mail.smtp.starttls.enable", "true");
val session = Session.getInstance(properties)
val message = new MimeMessage(session)
def getPasswordAuthentication(username:String, password:String):Authenticator=
{
new Authenticator(){
override def getPasswordAuthentication():PasswordAuthentication = {
new PasswordAuthentication(username, password);
}}
}
// Set the from, to, subject, body text
message.setFrom(new InternetAddress("no-reply@****.com"))
message.setRecipients(Message.RecipientType.TO, "ajayv@****.com")
message.setSubject("Count of DeviceIDs we are sent daily")
message.setText(bodyText)
// And send it
Transport.send(message)
}
}
hooks
并重新安装ios平台。