`npm install elm` locally

Hi There

If I npm install Elm globally (with ‘-g’ flag), everything is great and it installs fine.

If I try to install it locally (without ‘-g’ flag) then it fails with lots of errors like this one, even when installing the exact same specific version. This also happens when installing via package.json and on the build server.

../fsevents.cc:50:32: error: no template named 'Handle' in namespace 'v8'

I’m trying out CircleCi, which doesn’t give me permissions to install globally on the build server, so I’m kind of stuck (although I could just use a different build server).

Any thoughts welcome, thanks, Cedd

Hi!

  • What operating system?
  • Node.js version?
  • npm version?
  • What is an exact command you run that fails?

I’m surprised the error message mentions fsevents. The elm package doesn’t even depend on fsevents. elm-test does, though.

I use elm installed locally for my projects and it’s not an issue, so I don’t think that it’s related to that. However, if you do want to try installing it globally on your CI server, you should be able to change the location of your global NPM install directory: docs.npmjs.com/fixing-npm-permissions.md at master · mixonic/docs.npmjs.com · GitHub

1 Like

Hi There, thanks for the response!

It seems to be working this morning! Yesterday I saw this on the output

node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v83-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@14.15.5 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)

And I don’t see it today. So I think what happened is that the pre built binary wasn’t available to download yesterday, and building from source failed.

This morning the pre built binary is available, so that fact that it can’t compile from source doesn’t matter.

Cheers, Cedd

Just to clear potential confusion, note that this is pre-built binaries for fsevents, not Elm. So I suspect you try to install something else at the same time. Glad it works for you now!

1 Like

Hi there, I don’t think this is what I see actually, for example this is a snippet from when I was having the problem.

➜  elm-platform-worker-example git:(main) ✗ npm install elm@0.19.1-5

> fsevents@1.2.4 install /Users/ceddburge/repos/elm-platform-worker-example/node_modules/elm-test/node_modules/fsevents
> node install

node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v83-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@14.15.5 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
../fsevents.cc:50:32: error: no template named 'Handle' in namespace 'v8'
    static void Initialize(v8::Handle<v8::Object> exports);

Weird that it mentions elm-platform-worker-example/node_modules/elm-test when you ask it to install elm@0.19.1-5.

1 Like

Yeah, that is weird. There is clearly something I don’t understand about the way npm works. So probably if I hadn’t already installed elm-test then it would have worked, as Elm doesn’t depend on fsevents, and it wouldn’t have tried to do whatever it is doing here.

npm - its sort of like a lottery crossed with a package tool.

4 Likes

Looks like you are on a Mac (Darwin)?

I need to about once a month reinstall xcode command line tools to fix this type of error. Not sure what breaks it. Maybe some behind the scenes update from Apple. Try that maybe…

2 Likes

Thanks Mika, I had in fact already done that :slight_smile: I am fairly new to the Mac so still getting used to the idiosyncracies!

Matthieu put me on to elm-tooling , which I think I’m going to use in the future. It sounds a lot better in pretty much every way for getting the elm tools, both locally and on the build server.

6 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.