Mac system jmvtools check does not work

Everything related to the development of modules in jamovi
LizXSam
Posts: 4
Joined: Thu Mar 31, 2022 2:51 am

Mac system jmvtools check does not work

Post 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!
User avatar
jonathon
Posts: 2743
Joined: Fri Jan 27, 2017 10:04 am

Re: Mac system jmvtools check does not work

Post 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
rcalinjageman
Posts: 14
Joined: Thu Nov 12, 2020 1:49 am

Re: Mac system jmvtools check does not work

Post 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.. :-(
rcalinjageman
Posts: 14
Joined: Thu Nov 12, 2020 1:49 am

Re: Mac system jmvtools check does not work

Post 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?
rcalinjageman
Posts: 14
Joined: Thu Nov 12, 2020 1:49 am

Re: Mac system jmvtools check does not work

Post by rcalinjageman »

The node package/wrapper that got installed with jmvtools does not seem to come with an osx version of node.js.
User avatar
jonathon
Posts: 2743
Joined: Fri Jan 27, 2017 10:04 am

Re: Mac system jmvtools check does not work

Post 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
rcalinjageman
Posts: 14
Joined: Thu Nov 12, 2020 1:49 am

Re: Mac system jmvtools check does not work

Post by rcalinjageman »

I get:

> node::node()
[1] ""
> file.exists(node::node())
[1] FALSE
rcalinjageman
Posts: 14
Joined: Thu Nov 12, 2020 1:49 am

Re: Mac system jmvtools check does not work

Post 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
User avatar
jonathon
Posts: 2743
Joined: Fri Jan 27, 2017 10:04 am

Re: Mac system jmvtools check does not work

Post 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
rcalinjageman
Posts: 14
Joined: Thu Nov 12, 2020 1:49 am

Re: Mac system jmvtools check does not work

Post 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.
Post Reply