FSC identikit with node.js install on mac - is it possible?

Hi FSC Forum.
I’m finally getting chance to have a go at building an identikit resource but seem to have fallen at the first hurdle - installing and running identikit on a mac (running High Sierra - OSX 10.13.6).
On a previous machine with the same OS I installed and ran the ‘online/website’ based version of identikit but unfortunately that laptop is now deceased.
I’m now attempting to install on my new machine but the as the tombiovis has been updated to node.js I cannot get it to run.
Attempting to install via terminal and it seems to have pulled down all the ‘npm install’ packages BUT won’t start - seems to be missing a .json package?
Is there additional steps I need to undertake to get it run or is the resource now purely windows/PC based.
Any advice from mac users (I assume there are some in the FSC community) would be greatly appreciated.
Thank you in advance,
Richard

Hi Richard! It should be fine on Mac with Node installed. Did you follow the instructions here: https://fieldstudiescouncil.github.io/tombiovis/docs/quickstart.html? If so can you confirm that the steps 1-6 (with 5 adjusted for Mac as noted) appeared to work okay?

Rich

Hi Rich,
Thank you for your prompt reply and apologies for my delayed reply!
I followed the quickstart quide and used terminal in lieu of .bat to ‘load’ node.js. using the command npm.install.
It refused a number of times but eventually seemed to install (although it did flag a few ‘low-level’ security issues) and I had to manually create an install folder which it then subsequently ignored…
When attempting to start identikit using npm start I get a terminal report of no such file or directory, open '/Users/macuser/package.json
I suspect it is possibly to do with the node.js not being installed in the correct ‘file path’ or npm start being pointed to the wrong location - I tried a few location options with no success and think it is a case of ‘operator error’ on my behalf. (OR an additional javascript package being required?)
I’m not very experienced with terminal or java script (much more familiar with coding for physical computing ie arduino etc - so happy to learn). I hoped there might be another mac user on the forum who could offer some guidance (there must be some other poor souls still beholden to the accursed apple!)
Let me know your thoughts and when I can get it to run will happily draft some guidance notes for other mac users.
Hope you are well and not too busy!
cheers
Richard

Hi Richard. I’m not a Mac user myself and don’t have access to one but, nevertheless, I think that this should work. From the terminal in the folder where you ran ‘npm install’ and ‘npm start’, can you list the files/folders in that folder and send me a screenshot so I can see what’s there?

Rich

Hi Rich. I wish I wasn’t a mac user (but got stuck back in the day for design software I used; due to adobe’s extortionate costs I now can’t afford to switch everything to PC)…
Anyhoo - I’ve tried a different tack for installing node.js using Homebrew which seemed to work. (npn -v & node -v don’t throw an error so I guess this means they are there?)
I still get the same error in terminal when running npm start.
Reinstalled via the node.js pkg just in case (which again seems to work) but get the same error.
I’ve had a quick wander around stackoverflow and it seems to be NO ENTITY error (ENOENT) so feel I am pointing the command line to the wrong place or missing something I need to put in place.
I’ve attached a screen shot of the terminal screen + the logs I’m getting just in case that is of use. (MAC helpfully hides logs from users unless revealed using a terminal command - how very helpful???)

Many thanks for your time in looking at this and I do suspect it is user error on my part - I’m at the limit of my understanding of the mac hierarchy and set up.

Let me know what you reckon and I’ll start looking into options for switching to PC…
many thanks
Richard

2020-07-25T09_39_28_157Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘start’ ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /Users/macuser/.npmrc. (matches userconfig)
5 verbose stack Error: ENOENT: no such file or directory, open ‘/Users/macuser/package.json’
6 verbose cwd /Users/macuser
7 verbose Darwin 17.7.0
8 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “start”
9 verbose node v12.18.3
10 verbose npm v6.14.6
11 error code ENOENT
12 error syscall open
13 error path /Users/macuser/package.json
14 error errno -2
15 error enoent ENOENT: no such file or directory, open ‘/Users/macuser/package.json’
16 error enoent This is related to npm not being able to find a file.
17 verbose exit [ -2, true ]

@arbarus I think I can see where you’re going wrong. Don’t worry about being on a Mac - Node runs great on Macs and other unix-like operating systems. The problem is a simple one, I think.

When you’re in the terminal to need to cd (change directory) to the folder where you extracted your tombiovis files. I extracted mine to a folder in my Downloads:

C:\Users\Charles\Downloads\tombiovis-1.9.0

So when I open terminal in Windows I issued the following command:

cd Downloads\tombiovis-1.9.0

My terminal already starts in C:\Users\Charles\ so I didn’t need to type in the whole path.

Then I ran the npm install command and finally npm start

This all worked as expect.

Here’s a log of my whole session:

pwsh> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Charles\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Charles\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Charles\scoop\persist\nodejs\cache\_logs\2020-07-25T15_53_57_689Z-debug.log

You can see here if I simply open up my terminal and run npm start I get the same error. This is because my tombiovis files aren’t in my home folder. Node needs a package.json file to install the files it needs to run an application. If it can’t find one, it shows us the ENOENT errors.

So I navigate to the correct folder and try again (you should be able to see the package.json file in there - if not, you’ve not extracted the files from the zip properly):

~
pwsh> cd .\Downloads\tombiovis-1.9.0\

~\..\tombiovis-1.9.0                                                                                           16:54:05
pwsh> npm start

> [email protected] start C:\Users\Charles\Downloads\tombiovis-1.9.0
> electron .

'electron' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Charles\scoop\persist\nodejs\cache\_logs\2020-07-25T15_54_20_411Z-debug.log

Oops, I can’t start the Identikit application because I haven’t installed the node files yet! I try again:

~\..\tombiovis-1.9.0                                                                                           16:54:20
pwsh> npm install

> [email protected] postinstall C:\Users\Charles\Downloads\tombiovis-1.9.0\node_modules\electron
> node install.js

Downloading tmp-24980-1-SHASUMS256.txt-3.1.8
[============================================>] 100.0% of 4.74 kB (4.74 kB/s)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 507 packages from 321 contributors and audited 575 packages in 119.137s
found 289 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

~\..\tombiovis-1.9.0                                                                                           16:56:34
pwsh> npm start

> [email protected] start C:\Users\Charles\Downloads\tombiovis-1.9.0
> electron .

And there you go. Where you see electron . that is Identikit firing up in my browser.

The warnings (the somewhat alarming WARN lines) are Windows-specific. You probably won’t see those on a Mac. They are telling us that a couple of optional packages can’t be installed because they don’t work on Windows. That’s OK, though, because they’re completely optional.

Also, do not be concerned about the “289 low severity vulnerabilities”. Rich updates the packages regularly and you’re only running the Identikit application locally (i.e. on your computer, not on a web server) so it’s not a problem, and Node is particularly zealous in reporting to you these things, so it looks more worrying that it actually is.

Hope this helps!

Charles

Hi Charles.
That’s spot on thank you. It was the cd command as you surmised (I’m not overly familiar with terminal so completely missed the command - I was just using a copied file path which was suggested on a forum somewhere…)
Once I’d found the tilde on the keyboard (and removed the space from my FSC indentikit folder) I seem to be hitting the correct place as the package.json file is in folder tombiovis-1.9.0.
I’ve tried the npm start commmand but am now seeing a Segmentation fault: 11 and no electron or browser launch.
Screen shot of the terminal window attached.
Not sure where to go now so fingers crossed you can give me another prompt!
Thank you for your assistance.
cheers
Richard
(no worries on the l. l. vulnerabilities, I ran the npm audit fix and obviously completely trust FSC to ensure stuff is fit for use!)

Screen Shot 2020-07-26 at 17.22.11

What happens when you run npm install ?

A couple of things to try:

Run npm rebuild

If that doesn’t help, try deleting the node_modules folder then run npm install again.

Let us know how you get on. :slightly_smiling_face:

Hi Charles
Sorry, should have said - npm install and npm rebuild produces the same error…(Segmentation fault: 11)
Will try the reinstall. Can you point me to the node_modules folder as it doesn’t appear in finder.
many thanks once again
cheers
Richard

Hi Charles
Just a thought that the Node.js install details may be of relevance…

cheers Richard

Screen Shot 2020-07-26 at 15.27.15

Hi both. You already adressed the problem which I suspected - i.e. in the wrong folder when running the commands. I don’t have any ideas on this segmentation fault. I googled it and found one or two similar issues (e.g. https://github.com/nodejs/node/issues/28536). I’m afraid I don’t know enough about Mac to help. As Charles said, it should be straight forward on almost any platform - that was one of the reasons for going with Node - I’m sorry it doesn’t seem to be the case for you Richard. :frowning:

I found this:

I suspect there is something wrong with how Node is installed on your Mac, Richard. What do you get when you run the following commands?

which npm
which node
npm -v
node -v

You could try updating npm as suggested in this answer

Does that help at all?

Hi Rich & Charles.
I’m sure it’s something I’m doing / have done wrong (much like my pointing commands at the wrong folder!). I’ve now tried a new tack - see second part of this reply for the good news!
Re Charles’s questions:
I’ve run the which npm, which node, npm -v, node -v and the results are:
Last login: Sun Jul 26 17:26:40 on ttys000
richardwsonspro:~ rdawson101$ cd ~/Desktop/FSCidentikit/tombiovis-1.9.0
richardwsonspro:tombiovis-1.9.0 rdawson101$ npm install
Segmentation fault: 11
richardwsonspro:tombiovis-1.9.0 rdawson101$ npm rebuild
Segmentation fault: 11
richardwsonspro:tombiovis-1.9.0 rdawson101$ which npm
/usr/local/bin/npm
richardwsonspro:tombiovis-1.9.0 rdawson101$ which node
/usr/local/bin/node
richardwsonspro:tombiovis-1.9.0 rdawson101$ npm -v
Segmentation fault: 11
richardwsonspro:tombiovis-1.9.0 rdawson101$ node -v
Illegal instruction: 4
richardwsonspro:tombiovis-1.9.0 rdawson101$

Perhaps that can shed some light on it? I suspect maybe something to do with node.js install as the node_modules folder isn’t there. The install did hang with an ‘waiting for other installs to complete’ error but that seemed to be a known issue from looking at other forums? A restart solved it.
I’m going to attempt to uninstall node.js and start from scratch as would like to understand what is going on and it may be of help to others & meanwhile:
**A second attempt = SUCCESS!
Taking what I have learnt from your input I tried again step-by-step on my workshop laptop and am very, very pleased to say it works!
I did use ‘homebrew’ to install node.js so would that make a difference?
I’ve attached the terminal log of the successful install as a .png in case it helps clarify what I did wrong on my desktop.
I will write up the steps I followed and post it onto the forum as it may be of use to others (and for my own benefit as I work in terminal so seldom I have to start anew each time!).

Once again many thanks for your time and help, and if you do get chance to look at the original problem further I’d be very keen to solve and understand it.
cheers
Richard

That’s great news Richard - glad you’ve solved it.

Rich

@arbarus My gut feeling about those segmentation fault errors is that it is possibly something to do with a broken Node installation. Reading back through your messages, it looks like Node was working, but you re-installed it via Homebrew. Even then, it seems as if it was working for a time:

Anyhoo - I’ve tried a different tack for installing node.js using Homebrew which seemed to work. ( npn -v & node -v don’t throw an error so I guess this means they are there?)

My suggestion would be to completely remove Node if you can and do a clean re-install. Start with uninstalling the Homebrew version. Then try using Node again to see if it works again. If it doesn’t try uninstalling any other versions of Node you might have installed.

Also, look for any node_modules folders in your home folder (type cd ~ to get to your home folder) or in likely places withing there (such as Desktop). This article describes how to search for and delete node_modules folders.

If all this seems rather complex, don’t worry, you’re not alone. Node have become somewhat notorious for being a little unwieldy. Not because it’s bad, but because it has grown way beyond what it was originally intended for. The same can be said of the JavaScript ecosystem generally - it has become obscenely complicated (even though it doesn’t need to be, and the industry is waking up to this - one of the best teachers of modern, approachable, uncomplicated JS is Chris Ferdinandi - e.g., have a listen to this podcast).

The good news is that the original author of Node has reinvented it to address the shortcomings, and the result - called Deno - was released just a few months ago. You can read about it here: https://www.jeremymorgan.com/blog/programming/what-is-deno/.

This doesn’t make any difference to Identikit because Deno is not compatible with Node and therefore Identikit would need to be rewritten to use Deno. But it does give us some hope that current difficulties are going to get progressively better over time (as technology tends to)

Hi Charles
Thank you for the additional guidance. I think my explanation (and process) became slightly muddled as I worked across my two machines but do suspect that the node/segmentation error is due to an incorrect install (weird that the non-homebrew installer froze initially). I will attempt a clean reinstall & let you know - probably over the weekend so I can spend some time focused on it.
I saw a couple of discussion re node becoming unwieldy - seem analogous to the arduino IDE which keeps getting ‘developed’ and has moved away from the simple and accessible tool it was originally. A shame, but difficult to strike the balance between expanded functionality and clarity for laymen & laywomen - my workaround is to stick with an ancient version that works for me (hence beholden to an old mac OS).
The open source culture is fantastic and a real boon to ‘dabblers’ like myself.
I have started playing with building an identikit resource now so will let you and Rich know how I get on (it won’t be a quick process I feel) and must say the supporting documentation is great!
I’ll let you know how I get on with installing on my desktop mac and will post the process that works in the hope it can be of use to others.
again thank you for your time and advice,
cheers
Richard

HI again Charles & Rich
Apologies for the delayed reply, I didn’t get my hoped free day at the weekend but as discussed I’ve had a proper play with installing on three different mac setups. It works fine on High Sierra and El Capitan but not on LION. I think this may be something to do with GIT (?) but is beyond my knowledge.
I’ve written up a step-by-step of how I installed and attached it below just in case it is on use to any other mac folk.

Managed to get chance to play with building an ID resource (with some success). Still lots to do to make it workable and presentable but it is a brilliant system and looking forward to getting chance to play further when I have some free time (and will doubtless be back in touch with questions).
many thanks & take it easy,
cheers
Richard

1 Like

Thanks Richard; this is really useful info - potentially very helpful to other mac users installing Identikit. Great work.