jgm / djot.js

JavaScript implementation of djot
MIT License
146 stars 16 forks source link

Can not install command line tool #10

Closed tbdalgaard closed 1 year ago

tbdalgaard commented 1 year ago

Have tried to install Djot.js several times.

I have to run the install script as sudo to get it to work since the admin user doesn't have the right levels of permisions to the /usr/local/lib/node_modules directory where Djot can be installed.

When I type djot into the terminal it says: Command not found. I installed Node.js from their website instead of using Homebrew hoping this would give better results.

jgm commented 1 year ago

Did the installation succeed? Do you see djot in /usr/local/bin? If so, is /usr/local/bin in your PATH?

Alternatively you can install your global npm packages in your user directory (and not need sudo):

mkdir ~/.npm-packages
npm config set prefix ~/.npm-packages
npm install -g .

djot should then be in ~/.npm-packages/bin, which you'd ned to add to your PATH.

tbdalgaard commented 1 year ago

No, I do not see djot in /usr/local/bin even when I ran the installer as sudo. I did not get any errors while installing so wonder what failed and how I can debug this.

jgm commented 1 year ago

Try the approach above for a user directory install.

tbdalgaard commented 1 year ago

Ok, now I got Node and NPM working as expected, but the installer fails here again.

´´´

I ran: npm run build

that returned

@.*** build tsc && webpack sh: tsc: command not found

´´´

tbdalgaard commented 1 year ago

Ok finally got the tsc installed as well, so now I run the installer which gives this error: Ran this from the djot repo directory after the npm run build

´´´ npm install -g djot-js

npm ERR! code ENOVERSIONS npm ERR! No versions available for djot-js

´´´

That's interesting since the build gave me a version number, so wonder what went wrong here.

jgm commented 1 year ago

This is because I unpublished the package (we're thinking of a different name). Try this:

npm install -g https://github.com/jgm/djot.js

I can try to fix npm run build so it doesn't assume a global install of tsc.

tbdalgaard commented 1 year ago

Thanks, I fixed it by using your suggestion in a recloned repo directory, and now it finally got installed! That's fantastic.

Yes, it would be great if the TSC was mentioned if not installed. This would have saved me quite some hours reinstalling stuff. It was just this morning I found that TSC wasn't installed.

Depending on the future of Djot, would it make any sense to make some more userfriendly documentation for the installation of Djot.js?

jgm commented 1 year ago

I think I've now fixed the tsc issue. Once we get this published on npm it should be a simple npm install -g djot (or whatever the npm name turns out to be).

tbdalgaard commented 1 year ago

Cool, I have now experimented for some hours, and i absolutely LOVE Djot!

I really hope this format can be included with Pandoc and other tools. I really see Djot as a great alternative for Markdown in so many cases. Both for people who writes blogs or just want to format their documents before converting them to docx or other known formats.

Djot has a very easy to learn syntax.

I am a Braille reader since I have no eye sight, and Djot makes formating my document so easy. I liked Markdown and used it for years, but I think DJOT may replace this when it is released. If you are interested I could make some notes in a discussion over at the syntax repo. Thanks for a great project and for helping me getting this to work!

Sendt fra min Mac Mini via Apple Mail

Den 6. jan. 2023 kl. 21.02 skrev John MacFarlane @.***>:

I think I've now fixed the tsc issue. Once we get this published on npm it should be a simple npm install -g djot (or whatever the npm name turns out to be).

— Reply to this email directly, view it on GitHub https://github.com/jgm/djot.js/issues/10#issuecomment-1374066795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGLXRQPUGPBGJ63X7GFLOTWRB24LANCNFSM6AAAAAATQAOUA4. You are receiving this because you authored the thread.

jgm commented 1 year ago

Glad to hear you finally got it to work! Feel free to make comments in the discussion area.