Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Install on windows not working #149

Closed
maacl opened this issue May 1, 2017 · 6 comments
Closed

Install on windows not working #149

maacl opened this issue May 1, 2017 · 6 comments

Comments

@maacl
Copy link

maacl commented May 1, 2017

I did a:

npm install -g lumo-cljs

on Windows 10, but invoking lumo at commandline results in file not found.

C:\Users%user%\AppData\Roaming\npm is in %PATH%

I can invoke lumo using the fully qualified path to:

C:\Users\%user%\AppData\Roaming\npm\node_modules\lumo-cljs\bin
@ScottFreeCode
Copy link

At a glance, it looks as though the .cmd file is hardwired to depend on Cygwin or MySys2 or some such Posix-on-Windows environment -- there are references to /bin/sh in both code paths. Which, besides not being obviously documented on the readme, is odd if the program itself seemingly runs fine on Node without /bin/sh or its Posix environment...

@anmonteiro
Copy link
Owner

Lumo on Windows is not meant to work with Cygwin. #142 is actually open to address that.

That said, I have no idea why this would be happening. Which version of Lumo are you trying to install?

@ScottFreeCode
Copy link

Installed lumo-cljs@1.4.1, and the full path method does work. Also reinstalled it and still get the same issue with reference to /bin/sh.

I dig a little digging and didn't come up with much, but did try installing a couple other global NPM libraries for comparison:

> grunt.cmd

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\node_modules\grunt\bin\grunt" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\node_modules\grunt\bin\grunt" %*
)

> mocha.cmd

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\node_modules\mocha\bin\mocha" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\node_modules\mocha\bin\mocha" %*
)

> lumo.cmd

@IF EXIST "%~dp0\/bin/sh.exe" (
  "%~dp0\/bin/sh.exe"  "%~dp0\node_modules\lumo-cljs\bin\lumo" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  /bin/sh  "%~dp0\node_modules\lumo-cljs\bin\lumo" %*
)

If any of this makes any difference, I'm using:

@anmonteiro
Copy link
Owner

Turned out to be a regression. Fixed now, will be in the next release

@ScottFreeCode
Copy link

I learned something today! I had no idea NPM lets you use non-Node scripts as your CLI and will adjust its proxy files accordingly.

I wonder if there's a way to use NPM's lifecycle scripts to replace the placeholder file with the real one before NPM examines it to determine how to call it. But I guess as long as it's working, that's what counts, right?

@anmonteiro
Copy link
Owner

anmonteiro commented May 2, 2017

Yeah, I'm still not sure the current solution is the best. I'm leaning towards just having a .js wrapper script that uses the child_process module to spawn the Lumo binary on NPM.

That would probably fix #142 too.

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

No branches or pull requests

3 participants