Mix Release - 'erlexec' not detected, when starting /any/ app, despite running fine in iex

Ok, thanks so much - there’s been a major update

I got it to work!.. And now it’s not working again :expressionless:

Explanation:

  • Firstly, I stumbled upon this helpful tutorial, and completed the first 4 steps, before I had the ideas for what’s written below, and switched to that. Unfortunately, I didn’t try the build process again yet, after having gone that far through the tut - only after I’d done both those 4 steps and what’s written below. So I can’t be sure which branch of steps ‘solved’ my original problem, and indeed, what’s gone on to cause the new errors. But I think what’s written below is where the progress came from.

Ok, so basically, the reason I was using Git Bash to run the script is because I’m very unfamiliar with both Git Bash and writing scripts for the Windows PowerShell - the original tutorial called for and demo’d the bash version, and I struggled to get the Windows .ps1 version to work, so I just used theirs, with bash. However, after you mentioned it, I went back to trying to figure out an equivalent .ps1 script - and got it to work!

Turns out that seemed to get things moving! Upon using the now-correct (it seems) .ps1 script, I started receiving new error-info, now (instead of the bash console) in the Windows PowerShell:

  1. Some stuff about node-sass not being correct (I had an intuition, however, that this wouldn’t affect the overall build/compilation success, just whether things would perform in the browser correctly, should I get to that stage? So I left it, for now. More on this, later…)

  2. It told me that: the supplied ‘releases’ (if I remember right), of ‘:tew_chat_2’ wasn’t one of the ones registered/suported, of: [:prod, :test, …] - I had a flash of intuition thus to change, in the top lvl mix.exs file, ‘:tew_chat_2’ in the releases kw list to ‘:prod’ - that did it! After changing this, it worked! It built, and seemed to run like a dream - starting it didn’t generate the original error of ‘no erlexec’, and the app itself worked great.

  3. I also noticed that the file path quoted as the output of the Mix Release build (_build/prod/rel/prod/bin/prod start) was different than the one output by running it all with Git Bash - thus, maybe it couldn’t find ‘erlexec’ because Git Bash expected the build to have a different path than Windows provided, and it was looking in the wrong place? Unsure on this of course, but thought it was noteworthy.

------ So, building & running the app succeeded - now I’ve run into more problems -----------

  1. I went back into my IDE to improve the app, running it now ofc with iex.bat -S mix phx.server, only now my hot-reloading - and seemingly even overall responding to some css changes after a forced, full-page-reload - was gone. I think everything else in the app was running fine (it looked fine in the browser). But not this. I could be wrong however, and maybe there was more that wasn’t working right (see below) already at this stage - note everything did seem to fully work, when using that first Mix Released app. Only now back in iex.bat, and on subsequent Mix Release builds, is is going wrong??

  2. I thought this might be due to those aforementioned node-sass errors, and that this would be a good time to try and fix them… in the latter at least, I was wrong :expressionless: I tried my hand at guides like this, this, and this, but nothing - in fact, I was getting different errors throughout.

Further Details

Now, the app still compiles with iex.bat -S mix and Mix Release - but it’s lost all its LiveView reactivity??

Everything at first looks right on screen, but e.g. none of the divs with phx-click events do anything when clicked, and nothing registers from them on the console (output info should be coming through, as well as on-screen changes). Conversely, the ‘regular’ Phoenix portions, including links etc, interaction with the database, seem to be working fine.

When I run the app from the terminal, I get this error (with other info populated around):


ERROR in ./css/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Cannot find module 'node-sass'


After re-setting my package.json to the original node-sass settings, I again tried this to reset node-sass - but trying to install it via npm install node-sass@4.14.1 gives me this error??:


Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-88_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-88_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@4.14.1 postinstall C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\David\\Documents\\Computer Projects\\Elixir\\Projects\\tew_chat_2\\apps\\phxapp\\assets\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@15.5.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:199:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:199:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python39\python.EXE
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: C:\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:333:12)
gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
gyp ERR! stack     at maybeClose (node:internal/child_process:1063:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\David\\Documents\\Computer Projects\\Elixir\\Projects\\tew_chat_2\\apps\\phxapp\\assets\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" 
"--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\David\Documents\Computer Projects\Elixir\Projects\tew_chat_2\apps\phxapp\assets\node_modules\node-sass
gyp ERR! node -v v15.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\David\AppData\Roaming\npm-cache\_logs\2021-01-04T10_42_11_472Z-debug.log

Going into phxapp/assets and running regular npm install doesn’t throw that error… but doesn’t solve the overall node-sass problem of the ‘module build failing’, either.


Apologies for how crazy and long this is all getting - anything anyone could do to help would be really, really appreciated, as I really need to finish this. Getting it back to ‘working’ would be so great.

Thanks so much!

Really appreciate it