Webpacker: Elm installer not working

Created on 25 Sep 2018  路  4Comments  路  Source: rails/webpacker

Hi there,

When I generate a new Rails app with Elm via rails new my-project --webpack=elm, I run into the following error:

$ /path/to/my-project/node_modules/.bin/elm package install --yes
There is no package command.

Run `elm` with no arguments to get more hints.

error Command failed with exit code 1.

This looks to be an Elm version problem - webpacker is using 0.19, but somewhere in there is the command elm package install, which became elm install in 0.19.

For context, I'm on Rails 5.2.1, yarn 1.9.2, and Elm 0.19.

Most helpful comment

I don't think that we released the 3.x stable version since backporting the fix.
https://github.com/rails/webpacker/commits/3-x-stable

@gauravtiwari Can we get a release a new version of 3.x?

All 4 comments

This is resolved in the v4 release looks like it was addressed in this PR: https://github.com/rails/webpacker/pull/1691

I'll create a PR to merge into 3-x-stable

Guys, this still isn't working on v3.5.5. I get the following error:

         run  yarn run elm package install -- --yes from "."                                   
yarn run v1.10.1                                                                                     
warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
$ /Users/jameshamilton/sites/marketing_planner/node_modules/.bin/elm package install --yes                                                                                                                                            
events.js:167                                                                                                                                                                                                                         
      throw er; // Unhandled 'error' event                                                                                                                                                                                            
      ^                                                                                          

Error: spawn /Users/jameshamilton/sites/marketing_planner/node_modules/elm/unpacked_bin/elm ENOENT                                                                                                                                    
    at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)                                                                                                                                                         
    at onErrorNT (internal/child_process.js:406:16)                                                                                                                                                                                   
    at process._tickCallback (internal/process/next_tick.js:63:19)                                                                                                                                                                    
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)                                                                                                                                                                
    at startup (internal/bootstrap/node.js:236:19)                                                                                                                                                                                    
    at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)                                                                                                                                                                         
Emitted 'error' event at:                                                                                                                                                                                                             
    at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12) 
    at onErrorNT (internal/child_process.js:406:16)                                                
    [... lines matching original stack trace ...]                                                  
    at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)                                       
error Command failed with exit code 1.                                                      
info Visit https://yarnpkg.com/en/docs/cli/run

It still appears to be using the elm package command which has been removed.

I don't think that we released the 3.x stable version since backporting the fix.
https://github.com/rails/webpacker/commits/3-x-stable

@gauravtiwari Can we get a release a new version of 3.x?

My old app that had a working Elm setup has now broken without any code changes on my end. I tried creating a new Rails app to test/debug and find Elm is also not working with a new app.

It looks like I get a few errors:

  • There is no package command.
  • Errno::ENOENT: No such file or directory @ rb_sysopen for elm-package.json

After updating to Webpacker 4 rc5 I am getting the following error:
Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'babel-plugin-syntax-dynamic-import'
Did you mean "@babel/syntax-dynamic-import"?

Was this page helpful?
0 / 5 - 0 ratings