emacs-math-preview: add math-preview dependency?

  • Open
  • quality assurance status badge
Details
2 participants
  • Christopher Howard
  • muradm
Owner
unassigned
Submitted by
Christopher Howard
Severity
normal
C
C
Christopher Howard wrote on 2 Jan 19:18 +0100
(address . bug-guix@gnu.org)
875xmxuliy.fsf@librehacker.com
Hi, the package emacs-math-preview requires nodejs package math-preview to be installed, in order to work. Would it be possible Somebody™ could create a package for that and add it as an explicit dependency for emacs-math-preview?

I know nothing about nodejs and am having trouble figuring out how to install math-preview myself on Guix. The README.md instructions in emacs-math-preview state:

Toggle quote (6 lines)
> It may be installed by issuing the command:
>
> ```bash
> > npm install -g git+https://gitlab.com/matsievskiysv/math-preview
> ```

However, if I do this, I get this error:

```
christopher@theoden ~$ npm install -g git+https://gitlab.com/matsievskiysv/math-preview
npm ERR! code ENOENT
npm ERR! syscall mkdir
npm ERR! path /gnu/store/lknvzfbwqffvvyflid5dpm53vbjg8kh4-node-18.19.0/lib/node_modules/math-preview
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, mkdir '/gnu/store/lknvzfbwqffvvyflid5dpm53vbjg8kh4-node-18.19.0/lib/node_modules/math-preview'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: /home/christopher/.npm/_logs/2025-01-02T18_16_26_364Z-debug-0.log
```

Evidently, I need to somehow pick a different path or something like that. If somebody could at least document the correct installation steps here, that would be helpful.

--
? Christopher Howard
? gemini://gem.librehacker.com

?????? ??? ????? ?? ????? ??? ????
M
M
muradm wrote on 3 Jan 13:30 +0100
(name . Christopher Howard)(address . christopher@librehacker.com)(address . 75295@debbugs.gnu.org)
87jzbc5bb5.fsf@muradm.net
Hi, normally nodejs packages are hard to import, since they have
tons of dependencies, just like crates for rust, while crates are
maintained in Guix and npm packages are not.

When I need nodejs package to be available for emacs, I once
install it globally:

guix shell node -- npm install -g

Then next time I need an instance of emacs with it, I would run:

guix shell node -- emacs

Beware, that if you run emacs without node available, math-preview
would not be available as well.

If you normally don't have any thing complex to do with node (like
having multiple nodejs versions, environments etc.), you may add
it to your profile.

Christopher Howard <christopher@librehacker.com> writes:

Toggle quote (39 lines)
> Hi, the package emacs-math-preview requires nodejs package
> math-preview to be installed, in order to work. Would it be
> possible Somebody™ could create a package for that and add it as
> an explicit dependency for emacs-math-preview?
>
> I know nothing about nodejs and am having trouble figuring out
> how to install math-preview myself on Guix. The README.md
> instructions in emacs-math-preview state:
>
>> It may be installed by issuing the command:
>>
>> ```bash
>> > npm install -g
>> > git+https://gitlab.com/matsievskiysv/math-preview
>> ```
>
> However, if I do this, I get this error:
>
> ```
> christopher@theoden ~$ npm install -g
> git+https://gitlab.com/matsievskiysv/math-preview
> npm ERR! code ENOENT
> npm ERR! syscall mkdir
> npm ERR! path
> /gnu/store/lknvzfbwqffvvyflid5dpm53vbjg8kh4-node-18.19.0/lib/node_modules/math-preview
> npm ERR! errno -2
> npm ERR! enoent ENOENT: no such file or directory, mkdir
> '/gnu/store/lknvzfbwqffvvyflid5dpm53vbjg8kh4-node-18.19.0/lib/node_modules/math-preview'
> npm ERR! enoent This is related to npm not being able to find a
> file.
> npm ERR! enoent
>
> npm ERR! A complete log of this run can be found in:
> /home/christopher/.npm/_logs/2025-01-02T18_16_26_364Z-debug-0.log
> ```
>
> Evidently, I need to somehow pick a different path or something
> like that. If somebody could at least document the correct
> installation steps here, that would be helpful.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEESPY5lma9A9l5HGLP6M7O0mLOBeIFAmd32H4ACgkQ6M7O0mLO
BeJTmA//d3/ZPyRYG4QLVAu5Qf9NYSKjM2yS5FDQby3C5/DG0vXmsXCPEpa2Tvar
fw6puUjN0QlxLGyqOttPnrewL4I14P6vgX3a+mu0iJAZ3y1Rn4Q6h9IaNod/i7Vx
J1TqZf2ZviNAEPwd6yXaHDf480Y4sNEuReUaia/pXaULJ/Hxas3peJwX/WJfwBoj
GE9gJ4iZSKOwYy1qZfs7WZpOpxsQ5MFlQmfCrgckfiqJvlU51HUnNLKq6yit8Elt
rj0hbAE8rWGaYrCSYqBVMoUg9bqXHxNMLSZB7Vl7j1pyERKusGPeZzl+0Gms2MJa
R+I42Ru0vZ5EcxTAcVYmtaRxzRo2KlsAsRRUxZEuHyFs5aAKGpPDq1pA0DeGSWzs
A48uwCUUbRnequTCxSLhjZIKhIks4/rcdOVTpTL2jtHYqtMP/c54jpM9a+urigY9
aOKobQwci5keHjOlD0I+z0uK+3gsHnrsbwYXw8lMgthODSzxxQTk+soDMsqe+/iw
0jqjwGVs2+tnMqPPFQHQ9f6rTRBFlo82dPN292v1g+KunxY0+oKKHCIOdwaiCl4W
S0nsD8meJsg+F+uEEb/+SxgyqJgTqX8WkqQsYSgcNsCTC6uacfoIIbrlvA4FJiKf
SOTFTL5WAh2t1K1jcpxObyRgs/KpPMidRe3sBkPL4d0xIVpAtlI=
=ytJJ
-----END PGP SIGNATURE-----

C
C
Christopher Howard wrote on 3 Jan 18:09 +0100
(name . muradm)(address . mail@muradm.net)(address . 75295@debbugs.gnu.org)
87wmfb25ac.fsf@librehacker.com
muradm <mail@muradm.net> writes:

Toggle quote (3 lines)
> guix shell node -- npm install -g
> git+https://gitlab.com/matsievskiysv/math-preview

Does this command actually work for you? When I try, I get this error

```
90 verbose stack Error: ENOENT: no such file or directory, mkdir '/gnu/store/lknvzfbwqffvvyflid5dpm53vbjg8kh4-node-18.19.0/lib/node_modules/math-preview'
```

Do you have some necessary node configuration set up which I don't?

--
Christopher Howard
M
M
muradm wrote on 3 Jan 18:54 +0100
(name . Christopher Howard)(address . christopher@librehacker.com)(address . 75295@debbugs.gnu.org)
87sepz3hqy.fsf@muradm.net
Ah.. you also need to configure NPM. Mine is set as following:

mkdir -p ~/.config/npm
mkdir -p ~/.local/share/npm
echo "prefix=/home/muradm/.local/share/npm" > ~/.config/npm/config

Then you can use "npm install -g ...".

Christopher Howard <christopher@librehacker.com> writes:

Toggle quote (15 lines)
> muradm <mail@muradm.net> writes:
>
>> guix shell node -- npm install -g
>> git+https://gitlab.com/matsievskiysv/math-preview
>
> Does this command actually work for you? When I try, I get this
> error
>
> ```
> 90 verbose stack Error: ENOENT: no such file or directory, mkdir
> '/gnu/store/lknvzfbwqffvvyflid5dpm53vbjg8kh4-node-18.19.0/lib/node_modules/math-preview'
> ```
>
> Do you have some necessary node configuration set up which I
> don't?
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEESPY5lma9A9l5HGLP6M7O0mLOBeIFAmd4JGUACgkQ6M7O0mLO
BeKVbA//UxXSr5AQY/uvF8F2mwy1bpkcwe2kjm92Y0ExmBT2mZbNQqld5dQz2IMZ
9hVSjMOIRqXTEuiirnZCdkeBrVIXsoCtqd76dE3mirOHOfO7wvVFz9ky+Flt4lAu
dr8MEs0cwPod06TDR87nhsKSiG8Dpz/PxnIgnwyRt6ksAhX9BxQFg/itPrwIxUui
yg/uJeNNyPnWKbX9VTloUDyUBxeUlkZIT4/vy6wJU6MQwKlXTajhQKtCSFQU4FMs
4gF9wbnobTwT5cYerzJpEvl4waF9RmgYymJ/qeVP0nBQf5AydW5L6iuhrjLEG8Ym
FSbdN6F722TQkaungNdBbqZUJ0cbtwBnxezAm0ye36KFXuUhq1HU0FugEhVS3yuf
H+831oDMAM8BI1ARnYqlUMfA2qaOFojGjr3HsAfzSAtOtFquQhOH4teqaUjNbvXt
FARd4vfzQxMsufxG63Sm0ZWsoeCS+5B9b00Qzp509txT5yGV7Rss+8YvYSDyoe/i
adb9Cd83vKc0CcGMknQPbJkm961jhHnO/pi1Jf5otaFNRvJFjhUO7iDkaXBuwTeL
QiC2/x1NTYkL3hL9Ymd2DNnGB/EWhDsREZ5Mg9v+DgTsu3VGQgfKg9t3qcSiVtbo
owqOQ6ldfKM/C0lVEHrjjMhT3qQC2BelJIyXTSpMbSpc6REZSm8=
=QAIL
-----END PGP SIGNATURE-----

C
C
Christopher Howard wrote on 3 Jan 19:18 +0100
(address . 75295@debbugs.gnu.org)
877c7blq0n.fsf@librehacker.com
muradm <mail@muradm.net> writes:

Toggle quote (7 lines)
> mkdir -p ~/.config/npm
> mkdir -p ~/.local/share/npm
> echo "prefix=/home/muradm/.local/share/npm" > ~/.config/npm/config
>
> Then you can use "npm install -g ...".
>

Okay, thank you. Before reading this, I chatted with somebody on #node.js and they suggested "npm set prefix". I set my install prefix that way, and then I was able to run the install command with no issues. Now math-preview functions are working in my Emacs buffers.

So, I'm up and running. But I'd be inclined to keep this bug open, in case it might inspire someone to put together a package for that math-preview dependency.

--
Christopher Howard
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75295@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75295
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch