Page 1 of 2

Mac system jmvtools check does not work

Posted: Fri Apr 01, 2022 6:13 pm
by LizXSam
Hello, I have encountered a problem when trying to create a Jamovi module for Mac, the command
jmvtools:: check()
returns error:
jmvtools::check("~Applications/jamovi.app")
sh: : command not found
Warning message:
In system2(exe, args, wait = TRUE) : error in running command

jmvtools::check(home = "~Applications/jamovi.app")
sh: : command not found
Warning message:
In system2(exe, args, wait = TRUE) : error in running command

jmvtools::check(home = "/Applications/jamovi.app")
sh: : command not found
Warning message:
In system2(exe, args, wait = TRUE) : error in running command

What is the issue that's causing this problem? How do solve it or is there another way around to create a module on Mac?

Thanks!

Re: Mac system jmvtools check does not work

Posted: Fri Apr 01, 2022 11:56 pm
by jonathon
hi,

i'm a little puzzled by this, because it's reporting that the sh command is not found ... sh is a tool available on all macOS systems, so i'm not sure why it wouldn't be finding it.

could you open a terminal, and run the command

/bin/sh

and see if it works.

kind regards

Re: Mac system jmvtools check does not work

Posted: Tue Apr 05, 2022 7:27 pm
by rcalinjageman
Getting the same thing.
Fresh install of OsX11 in a VMWare player, fresh install of R (4.1.3) and RStudio (2022.02.1 Build 461).
Can compile my module in R studio, and install of jmvtools is fine, but jmvtools:check(), jmvtools:install(), and jmvtools::create() give:

sh: : command not found
Warning message:
In system2(exe, args, wait = TRUE) : error in running command

Opening a terminal and running /bin/sh starts sh.

Tried setting jamovi_home, but same thing. Soo close to getting this vmware install to build my module.. :-(

Re: Mac system jmvtools check does not work

Posted: Tue Apr 05, 2022 8:43 pm
by rcalinjageman
I've downloaded jmvtools to do some snooping. It builds, but node returns "".

So the issue is not that sh is not found-- system2 is relaying a message that the argument passed to be executed is not found. I don't fully understand the included node package that wraps node.js, but it looks like, at least in the default configuration I've stumbled upon, it isn't passing anything into R?

Re: Mac system jmvtools check does not work

Posted: Tue Apr 05, 2022 9:24 pm
by rcalinjageman
The node package/wrapper that got installed with jmvtools does not seem to come with an osx version of node.js.

Re: Mac system jmvtools check does not work

Posted: Tue Apr 05, 2022 11:20 pm
by jonathon
So the issue is not that sh is not found-- system2 is relaying a message that the argument passed to be executed is not found.
ah, that's some good troubleshooting bob!

what does running

node::node()

return?

if it returns something, what does:

file.exists(node::node())

return?

with thanks

Re: Mac system jmvtools check does not work

Posted: Tue Apr 05, 2022 11:59 pm
by rcalinjageman
I get:

> node::node()
[1] ""
> file.exists(node::node())
[1] FALSE

Re: Mac system jmvtools check does not work

Posted: Wed Apr 06, 2022 12:07 am
by rcalinjageman
I get:

> node::node()
[1] ""
> file.exists(node::node())
[1] FALSE


If I downgrade node with:

devtools::install_version('node', version = "1.0", repos=c('https://repo.jamovi.org', 'https://cran.r-project.org'))

Then I get:

> node::node()
[1] "/Library/Frameworks/R.framework/Versions/4.1/Resources/library/node/node-darwin/bin/node"
> file.exists(node::node())
[1] TRUE

But in that case, jmvtools::check gives an error... maybe expecting a different version of node.js complier?:

/Library/Frameworks/R.framework/Versions/4.1/Resources/library/jmvtools/node_modules/jamovi-compiler/index.js:52
(async function() {
^^^^^^^^
SyntaxError: Unexpected token function

Re: Mac system jmvtools check does not work

Posted: Wed Apr 06, 2022 12:09 am
by jonathon
could you run this:

installed.packages()['node','LibPath']

it will tell you where the node package is installed. then navigate to that location and tell me what's there.

there's *supposed* to be a node/node-darwin/bin/node

with thanks

Re: Mac system jmvtools check does not work

Posted: Wed Apr 06, 2022 12:12 am
by rcalinjageman
Working from the downgraded version of node, I baked up the version of node it came with and copied the 16.14.2 version into: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/node/node-darwin/bin/node.

That lets jmvtools:check() run!

And jmtools:install() gets started, but eventually crashes... looking into this. My guess is the right solution will be an update to node, but continuing to tinker a bit in the meantime.