OpenJSCAD.org icon indicating copy to clipboard operation
OpenJSCAD.org copied to clipboard

jscad cli does not work via clean install on fresh linux machine

Open DavidLyon66 opened this issue 1 year ago • 1 comments

Expected Behavior

Jscad CLI to be able to run from command line after installation on linux

Actual Behavior

Jscad cli interface does not work with modeling

Steps to Reproduce the Problem

  1. install jscad cli as per documented instructions on a fresh ubuntu installation ie, sudo npm install -g @jscad/cli
  2. save a jscad example from off openjscad.xyz to a disk file
  3. run 'jscad -o , an error is shown and the executable will not work.

Specifications

  • Version: 2.12
  • Platform: linux ubuntu
  • Environment: (browser, local server, node.js etc) bash

2024-04-24-213431 2024-05-03-033421 2024-05-03-035320 2024-05-03-040155

DavidLyon66 avatar May 02 '24 19:05 DavidLyon66

@DavidLyon66 Yeah. You're correct. The 'global' installation does not work, and the documentation needs to be corrected.

The proper way to use the CLI is via a local project. There are many reasons for this but here's a really good discussion about the general issue of installing and maintaining global NPM packages. It's not a good idea.

https://www.sitepoint.com/solve-global-npm-module-dependency-problem/

I suggest creating a new local NPM package, and install the CLI as a dependency. You can then maintain that local package (and dependencies), and run the CLI in scripts, etc.

And if you really really need a global CLI then use NPM link.

z3dev avatar Jun 13 '24 00:06 z3dev