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

steps to add node support are not working #2967

Closed
bamwu opened this issue Jan 6, 2021 · 19 comments
Closed

steps to add node support are not working #2967

bamwu opened this issue Jan 6, 2021 · 19 comments

Comments

@bamwu
Copy link

bamwu commented Jan 6, 2021

Trying to follow the steps listed here:

https://www.cappuccino.dev/blog/2017/04/cappuccino-on-node-js.html

The npm-install script fails with several errors, beginning with:

  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:70:58: error: no template named 'Handle'

macOS 10.15.7
Xcode 12.2
Node 12.18.4
Cappuccino latest

@cappbot cappbot added this to the Someday milestone Jan 6, 2021
@cappbot cappbot added the #new label Jan 6, 2021
@cappbot
Copy link

cappbot commented Jan 6, 2021

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@mrcarlberg
Copy link
Member

I googled on this error and it looks like it is something with the node module fibers not compatible with Node 12. What versions of fibers do you use?

@bamwu
Copy link
Author

bamwu commented Jan 7, 2021

Not sure. It's something Cappuccino uses internally I guess or maybe something that one of its dependencies uses internally.

@mrcarlberg
Copy link
Member

I believe Fibers is installed when you run the file <Your Narwhal Folder>/packages/narwhal-node/bin/npm-install. It does not say which version in the file so it would be very good to know which version is installed when you run the script?

@ivucica
Copy link

ivucica commented Jan 27, 2021

https://gist.github.com/ivucica/aef34af616d481579c2a7fffac8a449d

fibers@5.0.0, node v12.19.0

@mrcarlberg
Copy link
Member

It looks like you get fibers version 1.0.15 installed on line 10

> fibers@1.0.15 install /home/myusername/projects/cappuccino/narwhal/node_modules/synchronize/node_modules/fibers

@ivucica
Copy link

ivucica commented Jan 27, 2021

True.

I just spent some more time fiddling with this and independently found synchronize is the culprit, which is obvious once you pointed out the issue.

@ivucica
Copy link

ivucica commented Jan 27, 2021

I don't do development based on Node and Javascript usually (precisely why I'm here: for Objective-J), so after half an hour of playing with it, I still don't know how to work around this PR al6x/synchronize#73 not being merged, or the updated synchronize package not being released on NPM.

I also think Cappuccino 1.0.0's starter bundle's package.json might be using some outdated syntax for specifying dependencies; it's passing a JSON array instead of a dict (and this is still true on the master branch).

@ivucica
Copy link

ivucica commented Jan 27, 2021

To install the branch used in that pull request linked above al6x/synchronize#73, edit packages/narwhal-node/bin/npm-install to use this:

npm install fibers olisto/synchronize#node12 xmldom

This installs synchronize. However, that PR scopes the package, so it's no longer synchronize; it's instead @triggi/synchronize. Edit packages/narwhal-node/bootstrap.js and edit the line mentioning // using node's require():

const sync = require('@triggi/synchronize'); // using node's require()

At this point, running jake in $CAPPUCINO_STARTER_UNPACKED/narwhal/bin/jake says:

Wed Jan 27 2021 18:58:14 GMT-0000 (GMT) [error] Could not load package 'narwhal'. TypeError: Cannot find function forEach in object [object Object].
No Jakefile found (looking for: jakefile, Jakefile, jakefile.js, Jakefile.js, jakefile.j, Jakefile.j)

However, this is beyond what I can reasonably figure out how to fix. In fact, now I'm afraid I may have broken my rhino-based install...

@daboe01
Copy link
Contributor

daboe01 commented Mar 2, 2021

-#new
+tools

@cappbot
Copy link

cappbot commented Mar 2, 2021

Milestone: Someday. Label: tools. What's next? A reviewer should examine this issue.

@cappbot cappbot added tools and removed #new labels Mar 2, 2021
@daboe01
Copy link
Contributor

daboe01 commented Jan 7, 2022

@ivucica did you get it working in the meantime?

@enquora
Copy link
Contributor

enquora commented Apr 23, 2022

Is this still an issue, with current Node/npm minimum version requirements?

@daboe01
Copy link
Contributor

daboe01 commented Apr 24, 2022

i do not think so, because nobody else complained so far.
@mrcarlberg should we close this issue?

@ivucica
Copy link

ivucica commented May 17, 2022 via email

@daboe01
Copy link
Contributor

daboe01 commented May 17, 2022

+#works-for-me

@cappbot
Copy link

cappbot commented May 17, 2022

Milestone: Someday. Labels: #works-for-me, tools. What's next? Attempts to reproduce the problem described by this issue have failed to reveal any erroneous situation.

@cappbot cappbot closed this as completed May 17, 2022
@cappbot
Copy link

cappbot commented May 17, 2022

Milestone: Someday. Labels: #works-for-me, tools. What's next? Attempts to reproduce the problem described by this issue have failed to reveal any erroneous situation.

@mrcarlberg
Copy link
Member

Just some information if someone reads this in the future.

The current Node version is a total rework of the earlier try with a Node engine for Narwhal based on Fibers. This problem is not relevant anymore.

Anyone who wants to use the Node version should follow the install instructions on https://github.com/cappuccino/cappuccino/wiki/node

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

No branches or pull requests

6 participants