Skip to content

OpenJSCAD throws fs.js error under node.js 7.0.0 #198

@mrsimicsak

Description

@mrsimicsak

When running OpenJSCAD from the command line under node.js 7.0.0 the following error is thrown:
note: this is after applying the suggested fix in issue: #197.

~/OpenJSCAD.org$ openjscad examples/example001.jscad
converting examples/example001.jscad -> examples/example001.stl (STereoLithography, ASCII)
Blob: type [application/sla] size [386566]
fs.js:50
throw new TypeError('"options" must be a string or an object, got ' +
^
TypeError: "options" must be a string or an object, got number instead.
at getOptions (fs.js:50:11)
at Object.fs.writeFile (fs.js:1184:13)
at Object. (/usr/local/bin/openjscad:261:4)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.runMain (module.js:607:10)
at run (bootstrap_node.js:382:7)

Removing the 0, at the end of line 261 in openjscad fixes the problem.

I suspect this is caused by a node API change because the exact same line works in node v0.10.23, but I haven't been able to find when the API changed.

OpenJSCAD version:
~/OpenJSCAD.org$ git show
commit ea91305
Merge: 8269eff 1b94f54
Author: Z3 Development z3-dev@gfnews.net
Date: Sun Sep 11 11:08:52 2016 +0900

Merge pull request #171 from fischman/patch-1

Unbreak intersection() & difference() for CAGs.

node version:
~/OpenJSCAD.org$ node -v v7.0.0

Ubuntu version:
~/OpenJSCAD.org$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions