电子包括building.gyp中的openssl

时间:2017-07-28 17:27:30

标签: electron electron-builder webcryptoapi

我正在尝试在电子中使用node-webcrypto-ossl,这需要openssl libs并包含要包含在binding.gyp中的文件夹。

我尝试将其包含在目标

corpus.to.DTM <- function(corpus, min.doc.freq = 3, minlength = 3, weight.fun = weightTfIdf) {
    library(dplyr)
    library(magrittr)
    library(tm)
    library(parallel)

    lvls <- mclapply(corpus, function(doc) words(doc) %>% unique, mc.cores = 8) %>%
        unlist %>%
        table %>%
        data.frame %>%
        set_colnames(c('term', 'freq')) %>%
        mutate(lengths = str_length(term)) %>%
        filter(freq >= min.doc.freq & lengths >= minlength) %>%
        use_series(term)

    dtm <- mclapply(corpus, function(doc) factor(words(doc), levels = lvls) %>% table %>% as.vector, mc.cores = 8) %>%
        do.call(what = 'rbind') %>%
        set_colnames(lvls)

    as.DocumentTermMatrix(dtm, weighting = weightTfIdf) %>%
        as.matrix() %>%
        as.data.frame()
}

但它没有工作

1 个答案:

答案 0 :(得分:3)

在我的.npmrc中,我只需指定OpenSSL目录:

runtime = electron 
target = 1.6.11 
target_arch = x64 
disturl = https://atom.io/download/atom-shell
openssl_dir = /usr/local/ssl

我可以构建使用node-webcrypto-ossl

的电子应用程序