# Installing elm-pages (and other packages that depend on elm)

**URL:** https://discourse.nixos.org/t/installing-elm-pages-and-other-packages-that-depend-on-elm/8525
**Category:** Help
**Created:** [August 11, 2020, 5:45am UTC](https://discourse.nixos.org/t/installing-elm-pages-and-other-packages-that-depend-on-elm/8525 "2020-08-11T05:45:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sephi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sephi/32/7869_2.png) [@sephi](https://discourse.nixos.org/u/sephi)
#### Post date: [August 11, 2020, 5:45am UTC](https://discourse.nixos.org/t/installing-elm-pages-and-other-packages-that-depend-on-elm/8525/1 "2020-08-11T05:45:24Z")

</div>

I’m struggling to install the [elm-pages](https://github.com/dillonkearns/elm-pages/) package. I followed the readme and cloned the [elm-pages-starter template](https://github.com/dillonkearns/elm-pages-starter).

I first tried to `npm install` it, which failed:

```auto
> gifsicle@4.0.1 postinstall /tmp/elm-pages-starter/node_modules/gifsicle
> node lib/install.js

  ⚠ spawn /tmp/elm-pages-starter/node_modules/gifsicle/vendor/gifsicle ENOENT
  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c autoreconf -ivf
/bin/sh: autoreconf: command not found

```

I then thought I’d use `node2nix`, so I ran `node2nix -l`, which completed successfully. However, `nix-shell -A shell` fails, because apparently `elm-pages` has a dependency to `elm`, which, in its install script, tries to download the compiler binary, which fails because the network is not accessible during this phase.

```auto
> elm@0.19.1-3 install /nix/store/dw6jqasxzc28z55iiamymmp1gqg07ixh-node-dependencies-elm-pages-example-1.0.0/elm-pages-example/node_modules/elm
> node install.js

--------------------------------------------------------------------------------

Downloading Elm 0.19.1 from GitHub.

NOTE: You can avoid npm entirely by downloading directly from:
https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz
All this package does is download that file and put it somewhere.

--------------------------------------------------------------------------------

-- ERROR -----------------------------------------------------------------------

Something went wrong while fetching the following URL:

https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz

It is saying:

Error: getaddrinfo ENOTFOUND github.com

NOTE: You can avoid npm entirely by downloading directly from:
https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz
All this package does is download that file and put it somewhere.

--------------------------------------------------------------------------------

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! elm@0.19.1-3 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the elm@0.19.1-3 install script.

```

I’ve tried removing the `elm` package manually from the generated `node-packages.nix`, but got an error with another package that also downloads something during the install phase:

```auto
> sharp@0.23.4 install /nix/store/bcr9pq8qac1wxd1ldnkfv49b22k4m8rz-node-dependencies-elm-pages-example-1.0.0/elm-pages-example/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
unpacking source archive /nix/store/ifminfmdnsyyinwsfk7c6l2m9zcx24qi-sprintf-js-1.0.3.tgz
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz
ERR! sharp getaddrinfo ENOTFOUND github.com
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
make: Entering directory '/nix/store/bcr9pq8qac1wxd1ldnkfv49b22k4m8rz-node-dependencies-elm-pages-example-1.0.0/elm-pages-example/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:25:10: fatal error: vips/vips8: No such file or directory
   25 | #include <vips/vips8>
      | ^ ~~~~~~~~~~~
compilation terminated.
make: *** [sharp.target.mk:131: Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/nix/store/bcr9pq8qac1wxd1ldnkfv49b22k4m8rz-node-dependencies-elm-pages-example-1.0.0/elm-pages-example/node_modules/sharp/build'

```

I’m out of ideas. I guess I could try to package the `elm-pages` package, but I’m really scared by [the list of dependencies](https://github.com/dillonkearns/elm-pages/blob/8692e2885d2681442187cc5f6a8b52d6371b5fe4/package.json). I would just like to try out the `elm-pages` package, I don’t need the solution to be clean or perfect.

Any suggestion is appreciated!

---

<div class="post-metadata">

### Author: ![kodeFant](https://discourse.nixos.org/user_avatar/discourse.nixos.org/kodefant/32/3441_2.png) [@kodeFant](https://discourse.nixos.org/u/kodeFant)
#### Post date: [December 19, 2020, 11:31am UTC](https://discourse.nixos.org/t/installing-elm-pages-and-other-packages-that-depend-on-elm/8525/2 "2020-12-19T11:31:28Z")

</div>

I’m having the same issue myself. Built a blog on MacOS some time ago, but could not get it working with NixOS. Not even with the new webpack version. Luckily I still have a computer with MacOS. Another Linux distro would probably also work.

If elm-pages wouldn’t demand Elm to be installed through npm, and rather check if Elm is installed in any other way first, I imagine it would work by installing elm through nix instead. But that might be a decision the creator would have to make.

---

<div class="post-metadata">

### Author: ![Aarkon](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@Aarkon](https://discourse.nixos.org/u/Aarkon)
#### Post date: [June 12, 2021, 1:03pm UTC](https://discourse.nixos.org/t/installing-elm-pages-and-other-packages-that-depend-on-elm/8525/3 "2021-06-12T13:03:54Z")

</div>

I ran into the same problem just today. Luckily, I found your thread learning that least I’m not too stupid to use nix. 🙂

If you or anyone needs a quick workaround: `nix-shell -p nodejs autoreconfHook` seems to bring the proper toolchain so you can at least hack on your project on a nix machine. Building for deployment will fail, but starting the dev server works.

---

<div class="post-metadata">

### Author: ![sephi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sephi/32/7869_2.png) [@sephi](https://discourse.nixos.org/u/sephi)
#### Post date: [August 2, 2021, 9:03pm UTC](https://discourse.nixos.org/t/installing-elm-pages-and-other-packages-that-depend-on-elm/8525/4 "2021-08-02T21:03:24Z")

</div>

[elm-pages 2.0 was released yesterday](https://elm-pages.com/blog/introducing-v2/). From the release notes:

> v2 has removed Webpack, as well as many other NPM dependencies.

`npm install elm-pages` now works for me! 🎉
