jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.58k stars 505 forks source link

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

Open DavidLyon66 opened 2 months ago

DavidLyon66 commented 2 months ago

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

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

z3dev commented 3 weeks ago

@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.