Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refmterr cannot be npm installed #216

Open
jozanza opened this issue Nov 27, 2019 · 5 comments
Open

refmterr cannot be npm installed #216

jozanza opened this issue Nov 27, 2019 · 5 comments

Comments

@jozanza
Copy link

jozanza commented Nov 27, 2019

I tried installing nearly every version, and none of them work.

npm i -g refmterr yields the output such as this:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/<MISSING_PACKAGE> - Not found
npm ERR! 404 
npm ERR! 404  '<MISSING_PACKAGE>' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'refmterr'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

<MISSING_PACKAGE> is not deterministic but seems to be any of the following:

  • @opam/dune@*
  • @opam/atdgen@*
  • @opam/re@*
  • @opam/jbuilder@* (super old versions)

I'd really love to install refmterr as a standalone binary just like how I have refmt. But currently, it seems impossible to use it outside of an esy project 😢

Can you offer any advice/clarification/workarounds?

@jozanza jozanza changed the title refmterr Cannot be npm installed refmterr cannot be npm installed Nov 27, 2019
@bandersongit
Copy link
Contributor

Hi @jozanza, an immediate workaround would be to install using (esy)[https://esy.sh/] (you can still use your package.json and the commands are all essentially the same. Basically the errors you are getting are for packages that live in the opam registry (esy knows how to download packages from ocaml and npm/yarn do not).

@jordwalke probably has a sense of whether or not this is a feature or a bug. Nothing has changed recently, but I could maybe see there being value in having some kind of executable we could readily distribute

@jozanza
Copy link
Author

jozanza commented Nov 28, 2019

Thanks for the response @bandersongit!

I'm happily using plain old dune + opam in my project, so unfortunately, switching over to esy would be a bit of a hassle. I'll hold out for that executable 🤞😄

This is a bit off-topic but also somewhat related:
Upon further inspection, I'm realizing actually none of the @reason-native libs seem to be available on opam. So unfortunately, I can't use awesome libs like console and rely either. It'd be super cool if y'all could share these libraries in a way that doesn't force folks to adopt a particular package manager 🙏.

@bandersongit
Copy link
Contributor

Upon further inspection, I'm realizing actually none of the @reason-native libs seem to be available on opam. So unfortunately, I can't use awesome libs like console and rely either. It'd be super cool if y'all could share these libraries in a way that doesn't force folks to adopt a particular package manager 🙏.

I think that is something we actively want to do. @jordwalke actually did the work to create properly formed opam files for all of our libraries, so I think we are probably pretty close.

@jozanza
Copy link
Author

jozanza commented Nov 28, 2019

Very excited to hear that! I’ll keep my eyes on this issue for any updates. Thanks!

@jozanza
Copy link
Author

jozanza commented Dec 2, 2019

Small update 🎉

While these packages are not yet published on opam, as @bandersongit pointed out, they do have properly formed opam files. So it is possible to install and use them without esy via opam pin:

REASON_NATIVE_URL=https://github.com/facebookexperimental/reason-native.git
opam pin console $(REASON_NATIVE_URL)\#master --yes
opam pin pastel $(REASON_NATIVE_URL)\#master --yes
opam pin refmterr $(REASON_NATIVE_URL)\#master --yes
opam pin file-context-printer $(REASON_NATIVE_URL)\#master --yes
opam pin rely $(REASON_NATIVE_URL)\#master --yes

Of course, it would still be much nicer if they were published on opam 😉

Note: It also looks like there's a pin-depends stanza for .opam files, and it seems possible to use it in conjunction with the regular depends stanza to specify a pinned dependency. But I didn't really explore this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants