* bug#75295: emacs-math-preview: add math-preview dependency?
@ 2025-01-02 18:18 Christopher Howard
2025-01-03 12:30 ` muradm
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Howard @ 2025-01-02 18:18 UTC (permalink / raw)
To: 75295
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.
--
📛 Christopher Howard
🚀 gemini://gem.librehacker.com
🌐 http://gem.librehacker.com
בראשית ברא אלהים את השמים ואת הארץ
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#75295: emacs-math-preview: add math-preview dependency?
2025-01-02 18:18 bug#75295: emacs-math-preview: add math-preview dependency? Christopher Howard
@ 2025-01-03 12:30 ` muradm
2025-01-03 17:09 ` Christopher Howard
0 siblings, 1 reply; 5+ messages in thread
From: muradm @ 2025-01-03 12:30 UTC (permalink / raw)
To: Christopher Howard; +Cc: 75295
[-- Attachment #1: Type: text/plain, Size: 2259 bytes --]
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
git+https://gitlab.com/matsievskiysv/math-preview
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:
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#75295: emacs-math-preview: add math-preview dependency?
2025-01-03 12:30 ` muradm
@ 2025-01-03 17:09 ` Christopher Howard
2025-01-03 17:54 ` muradm
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Howard @ 2025-01-03 17:09 UTC (permalink / raw)
To: muradm; +Cc: 75295
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?
--
Christopher Howard
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#75295: emacs-math-preview: add math-preview dependency?
2025-01-03 17:09 ` Christopher Howard
@ 2025-01-03 17:54 ` muradm
2025-01-03 18:18 ` Christopher Howard
0 siblings, 1 reply; 5+ messages in thread
From: muradm @ 2025-01-03 17:54 UTC (permalink / raw)
To: Christopher Howard; +Cc: 75295
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
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:
> 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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#75295: emacs-math-preview: add math-preview dependency?
2025-01-03 17:54 ` muradm
@ 2025-01-03 18:18 ` Christopher Howard
0 siblings, 0 replies; 5+ messages in thread
From: Christopher Howard @ 2025-01-03 18:18 UTC (permalink / raw)
To: 75295
muradm <mail@muradm.net> writes:
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-01-03 18:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02 18:18 bug#75295: emacs-math-preview: add math-preview dependency? Christopher Howard
2025-01-03 12:30 ` muradm
2025-01-03 17:09 ` Christopher Howard
2025-01-03 17:54 ` muradm
2025-01-03 18:18 ` Christopher Howard
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.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).