@genericname1
Does this happen specifically when copying something inside BAS? In the script panel where the actions are or from the browser?
What version of BAS are you using?
Please record a video demonstrating the problem so that we can understand what is happening.
BAS и npm модули ноды
-
Приветы. Подскажите пж на какой козе к нему подъехать чтобы модули заработали в бас? Сутки мучаюсь с конвертацией html->pdf, docx->doc и все безуспешно. То модуль попросту не реагирует как его не вызывай, то бас не видит установленного модуля... у меня уже все там подгорает конкретно :D

-
@uraabk said in BAS и npm модули ноды:
@qwaros а каким кодом вызываете модуль?
var pdf = require('phantom-html2pdf'); var html_path = [[FILEINFO_BASE_DIRECTORY]]+"/"+[[RANDOM_STRING]]+".html"; var pdf_path = [[FILEINFO_BASE_DIRECTORY]]+"/"+[[RANDOM_STRING]]+".pdf"; var options = {"html": html_path}; pdf.convert(options, function(err, result) { console.log("Конвертация файла"); result.toFile(pdf_path, function() { console.log("Успешно"); }); });итак пробовал
var pdf = require('phantom-html2pdf'); var html_path = [[FILEINFO_BASE_DIRECTORY]]+"/"+[[RANDOM_STRING]]+".html"; var pdf_path = [[FILEINFO_BASE_DIRECTORY]]+"/"+[[RANDOM_STRING]]+".pdf"; var options = {"html": html_path}; await (new Promise((resolve, reject) => { pdf.convert(options, function(err, result) { console.log("Конвертация файла"); result.toFile(pdf_path, function() { console.log("Успешно"); }); }); resolve() })); -
@qwaros У Вас resolve не в том месте используется, попробуйте вот так. ( сам код не проверял)
var pdf = require('phantom-html2pdf'); var html_path = [[FILEINFO_BASE_DIRECTORY]]+"/"+[[RANDOM_STRING]]+".html"; var pdf_path = [[FILEINFO_BASE_DIRECTORY]]+"/"+[[RANDOM_STRING]]+".pdf"; var options = {"html": html_path}; await (new Promise((resolve, reject) => { pdf.convert(options, function(err, result) { console.log("Конвертация файла"); result.toFile(pdf_path, function() { console.log("Успешно"); }); resolve() }); })); -
> const pdf = require('phantom-html2pdf'); Error: Cannot find module 'phantom-html2pdf' at Function.Module._resolveFilename (module.js:527:15) at Function.Module._load (module.js:476:23) at Module.require (module.js:568:17) at require (internal/module.js:11:18) at repl:1:13 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at REPLServer.defaultEval (repl.js:239:29) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12) at REPLServer.onLine (repl.js:440:10) >Т.е бас не установил модуль выходит? Почему тогда он отображается в установленных? Ниче не пойму )))