Issues NPM installing all the required packages on AWS Linux server

I put the built react project in a git repository and intend to run it on a AWS Linux server,

Though I realised on the package.json dependencies, @needle-tools/engine, @needle-tools/react-three-fiber, three are referenced like file:…/…/Library/PackageCache/com.needle.engine@2.61.0-pre/package~, also I don’t see the npm package called @needle-tools/react-three-fiber online, so I don’t understand how npm would be able to npm install these packages, what do I do to be able to serve the built needle project on AWS Linux?

Original Post on Discord

by user 403031097107021824

When the project is built you don’t have the package.json / npm dependencies like this anymore - they are then baked in one (or many) Javascript files that you can host and serve on aws.

If you intent to do the build in an aws server you would need to replace the local file paths that you discovered with the versions that we published on npm (see the releases on the needle-tools organization on npm)

Sorry I wasn’t familiar with vite,
I thought to deploy it on linux was to serve it in the server with something like npm run start,

Though looking into vite, I now understand that only the built in dist is needed,

So my understanding now is that to deploy to a webserver I just need to serve the items in the dist folder, is this understanding correct?

@marcel :cactus: or anyone :pray:

by user 403031097107021824

Yes thats correct

With npm run start you get a local server for developing the app and for deploying you need to run npm run build:production (or make a production build from the Unity build window, right now compression is managed from Unity)

Is it expected that I unzip the index.html.gz?
I’m currently serving with live-server .

Though when I run live-server with index.html.gz,
The web returns the files so that I can browse or download the files

Though when I run live-server with index.html,
I see a white web page,

How exactly do I server the dist items?
Do you have any recommended methods?
Thank you very much, I’m not too familiar with this at the moment

@marcel :cactus: or anyone :pray:

by user 403031097107021824

You can either disable gzip compression in unity (see the unity build window in the needle engine tab) or you can possibly enable gzip compression on your webserver (if you google for it youll find information about what to put in a .htaccess file on your server to do it)

Yes it works! my gzip compression was checked, causing me confusion

by user 403031097107021824

Thank you @marcel :cactus:

by user 403031097107021824

No problem

If you can i would recommend trying to turn gzip on on your server since it reduces the filesizes quite a bit


by user 403031097107021824