emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Lundin <mdl@imapmail.org>
To: Ivan Sokolov <ivan-p-sokolov@ya.ru>, emacs-orgmode@gnu.org
Subject: Re: ob-js uses deprecated Node APIs
Date: Wed, 20 May 2020 15:05:36 -0500	[thread overview]
Message-ID: <874ksa2x2h.fsf@fastmail.fm> (raw)
In-Reply-To: <7652301583883715@vla1-a6eaa355d163.qloud-c.yandex.net>

Ivan Sokolov <ivan-p-sokolov@ya.ru> writes:

> I ran into problems with ob-js. When resolving them, I found that require ('sys') is deprecated, there is a patch.
>
> diff --git a/lisp/ob-js.el b/lisp/ob-js.el
> index 7592040ab..d459e8069 100644
> --- a/lisp/ob-js.el
> +++ b/lisp/ob-js.el
> @@ -65,7 +65,7 @@
>    :safe #'stringp)
>  
>  (defvar org-babel-js-function-wrapper
> -  "require('sys').print(require('sys').inspect(function(){\n%s\n}()));"
> +  "require('process').stdout.write(require('util').inspect(function(){%s}()));"
>    "Javascript code to print value of body.")
>  
>  (defun org-babel-execute:js (body params)

I can confirm that I just encountered this bug today and that Ivan's
patch resolves the issue.

See here for more information:

https://nodejs.org/api/deprecations.html#deprecations_dep0025_require_sys

Best,
Matt



  reply	other threads:[~2020-05-20 20:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 23:47 ob-js uses deprecated Node APIs Ivan Sokolov
2020-05-20 20:05 ` Matthew Lundin [this message]
2020-05-22 14:09 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ksa2x2h.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=ivan-p-sokolov@ya.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).