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.61k stars 511 forks source link

npm install @jscad/web fails (broken dependencies) #1131

Open GrreenZ opened 2 years ago

GrreenZ commented 2 years ago

Expected Behavior

npm install @jscad/web should install package in node_modules directory

Actual Behavior

$ npm install @jscad/web
npm ERR! code 1 npm ERR! path /home/pi/example/node_modules/@jscad/web npm ERR! command failed npm ERR! command sh /tmp/postinstall-7cfbdd30.sh npm ERR! internal/modules/cjs/loader.js:818 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module 'copy-dir'

There are two unfulfilled dependencies in source code

Steps to Reproduce the Problem

  1. mkdir broken-deps
  2. cd broken-deps
  3. npm init -y
  4. npm install @jscad/web

Specifications

z3dev commented 2 years ago

Looks like the post install step is incorrect. It should only link the examples when starting the development server, i.e. npm run dev

This can be done by moving the command to a new script called 'predev'.

z3dev commented 2 years ago

P.S. It's best to stay away from the NPM and LERNA standard lifecycle steps.

z3dev commented 2 years ago

@GrreenZ By the way, although you could use the WEB UI to create a website, we don't recommend it for many reasons.

If you are looking for a quick example website then see demo.html in packages/utils/regl-renderer