# Nodejs is not supported threejs？

**URL:** <https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362>\
**Category:** Questions\
**Tags:** nodejs\
**Created:** [February 1, 2022, 10:41am UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362 "2022-02-01T10:41:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![a6965921](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/a6965921/32/16019_2.png) [@a6965921](https://discourse.threejs.org/u/a6965921)\
**Post date:** [February 1, 2022, 10:41am UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362/1 "2022-02-01T10:41:43Z")

</div>

Nodejs is not supported threejs？ I want the server to render

---

<div class="post-metadata">

**Author:** ![ExoGeN](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/exogen/32/23277_2.png) [@ExoGeN](https://discourse.threejs.org/u/ExoGeN)\
**Post date:** [February 1, 2022, 10:59am UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362/2 "2022-02-01T10:59:37Z")

</div>

> [@a6965921](#):
>
> I want the server to render

That is not possible. Rendering is always frontend and need to be done by the client, because a Graphics Card is needed for rendering. You CAN set up a system to provide WebGL canvas for frontend.

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [February 1, 2022, 12:05pm UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362/3 "2022-02-01T12:05:42Z")

</div>

this will run under node: [GitHub - pmndrs/three-stdlib: 📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser](https://github.com/pmndrs/three-stdlib)

you can combine this with headless rendering, puppeteer for instance.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [February 1, 2022, 3:03pm UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362/4 "2022-02-01T15:03:28Z")

</div>

`three.js` has no official support for `node.js` however many setups work. For examples `three.js` uses `node.js` for generating screenshots from all official examples in context of E2E testing.

Like with any other WebGL content it’s important to run your code in an appropriate environment. The mentioned puppeteer project is a good start.

> **[GitHub - puppeteer/puppeteer: Headless Chrome Node.js API](https://github.com/puppeteer/puppeteer)**
>
> Headless Chrome Node.js API. Contribute to puppeteer/puppeteer development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ExoGeN](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/exogen/32/23277_2.png) [@ExoGeN](https://discourse.threejs.org/u/ExoGeN)\
**Post date:** [February 2, 2022, 6:40am UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362/5 "2022-02-02T06:40:54Z")

</div>

> [@Mugen87](#):
>
> For examples `three.js` uses `node.js` for generating screenshots from all official examples in context of E2E testing.

Wait a moment. So you telling me, that you can make screenshots from a 3D scene (canvas/div) from backend ? How do they do that? I thought that this is not possible.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [February 2, 2022, 9:12am UTC](https://discourse.threejs.org/t/nodejs-is-not-supported-threejs/34362/6 "2022-02-02T09:12:01Z")

</div>

I do not have the time to explain the approach in detail so I suggest you study the sources by yourself. You can find them here:

> **[three.js/test/e2e at dev · mrdoob/three.js](https://github.com/mrdoob/three.js/tree/dev/test/e2e)**
>
> dev/test/e2e

The script `puppeteer.js` contains the actual screenshot logic.
