Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency json5 in npm package #917

Closed
platypii opened this issue Sep 28, 2021 · 3 comments · Fixed by #919
Closed

Missing dependency json5 in npm package #917

platypii opened this issue Sep 28, 2021 · 3 comments · Fixed by #919

Comments

@platypii
Copy link
Contributor

platypii commented Sep 28, 2021

Expected Behavior

I have a jscad cli project. When I did npm upgrade I was no long able to compile my models with jscad.

Actual Behavior

After upgrading to the latest version, when I run jscad on the command line I get an error about missing json5 dependency. It appears it was added to jscad 8 days ago, but was not added to package.json for @jscad/core.

Steps to Reproduce the Problem

  1. npm i @jscad/cli
  2. npx jscad autopilot.js

Error:

internal/modules/cjs/loader.js:1032
  throw err;
  ^

Error: Cannot find module 'json5'
Require stack:
- /example/node_modules/@jscad/core/src/parameters/getParameterDefinitionsFromSource.js
- /example/node_modules/@jscad/core/src/code-loading/webRequire.js
- /example/node_modules/@jscad/core/src/code-loading/loadDesign.js
- /example/node_modules/@jscad/core/src/code-evaluation/rebuildGeometry.js
- /example/node_modules/@jscad/core/src/code-evaluation/index.js
- /example/node_modules/@jscad/core/src/index.js
- /example/node_modules/@jscad/cli/src/generateOutputData.js
- /example/node_modules/@jscad/cli/cli.js

Specifications

  • Version: @jscad/core 2.3.7
  • Platform: Linux CLI
  • Environment: (browser, local server, node.js etc) node.js
@z3dev
Copy link
Member

z3dev commented Sep 28, 2021

@platypii thanks for the heads up on this.

we'll get this fixed in the next release.

the work around is add this line to "dependencies" in packages/core/package.json

"json5": "^2.2.0",

Then run 'npm run clean' and 'npm run bootstrap' again.

@z3dev
Copy link
Member

z3dev commented Sep 28, 2021

FYI, the above work around does not correct the NPM packages. You should pull the previous version of the CLI. Sorry.

@platypii
Copy link
Contributor Author

My workaround was to explictly add json5 to my package.json file.

npm i json5

package.json:

{
  "dependencies": {
    "@jscad/cli": "^2.2.7",
    "json5": "^2.2.0"
  }
}

Then it works. Would be nice to have that in the @jscad/core dependencies though. Thanks, jscad rocks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants