-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Ability to specify version of Node in server templates #1469
Comments
I think this might be supported through dependencies in package.json:
The sandbox probably wasn't reloaded properly after adding the dependency. Closing. |
If anyone is here trying to figure out how to change the version of Node used in the server container feature of codesandbox.io, unfortunately you can't according to this response.
|
The node as a dependency workaround does work though: https://codesandbox.io/docs/faqs#can-i-change-the-node-version-used-in-a-container-sandbox I've updated my response in the linked thread. |
Thanks for the quick reply, and link to the documentation, @garethx. That worked for me. For the lazy, just do update your
Click the link @garethx shared above to see usage with Now we just need Google to return the docs page above this issue when searching for how to "change node version in codesandbox" :) |
The link to the documentation has changed it should be https://codesandbox.io/docs/start#can-i-change-the-node-version-used-in-a-container-sandbox The solution is set the node property in {
"node": 14
} |
This still isn't working for me in this Sandbox https://codesandbox.io/s/twitch-js-typescript-example-tnnys?file=/sandbox.config.json
{
"infiniteLoopProtection": true,
"hardReloadOnChange": false,
"template": "node",
"view": "terminal",
"container": {
"node": "12"
},
"node": "12"
} A dependency has
I can open a new terminal and switch to Node 12 with Any ideas? Edit: Node 14 works 🤔 |
Hey @marcandrews , For me it works with both node 12 and 14 in a fork of your original sandbox: Might be that you didn't restart the container after you changed the version in |
@lbogdan, I was having a lot of issues in general with Codesandbox that day, but they all seemed to be resolved the next day. Thanks for following up ❤️ |
Hey! Was just wondering if anyone can explain the difference between node and container.node? Reading the doc it's not really clear to me which one I want to set. |
@lbogdan actually the most confusing is that "node" is documented as "node" and also inside "container" (as "node"): Maybe just removing the top-level node would make this less confusing? |
Links dead m8 @garethx |
For future ref, the docs link is moved to: https://codesandbox.io/docs/learn/sandboxes/configuration#sandbox-configuration |
These seem to be the correct links: |
I can confirm that adding
|
This issue is a feature for the ability to specify the version of Node used on the server template. Currently, it only uses version 8.14.0 which is missing some important features.
I'm not quite sure. I believe packages.json supports the use of "engines". But some other method would be acceptable too.
The text was updated successfully, but these errors were encountered: