Launch application with nodejs
-
@Rémy-Verger It's not
node package.json
butnode path/to/the/application/
, so if you're already within the directory you can give it a.
as path (.
= current directory).
node .
ornode ./
ornode /var/www/
, those are equivalent. -
Oh !
Thanks dude but it's don't work.
Library probblem ? Or code error ? -
Does it work if you call
npm install
within /var/www first (I assume you havenpm
installed)? I just noticed you haven't done that yet, it installs dependencies for that project. -
@julian Did you mean
node package.json
? I don't see any server.json. Yes, I am sure. Calling the package.json with node will not start any application, It would (probably; I have no way proving this) interpret the JSON content alikerequire("./package.json")
but won't start themain
file. -
@julian server is a directory (see OP) it could be server/httpServer.js thought, but the package.json should specify the entry point anyways; Thus
node .
within the directory containing package.json is always best. -
Oh thanks i didn"t install npm
But now when i did "npm start" and i want to execute the code i got this errorty guys BTW
-
@Rémy-Verger run
npm start
from/var/www
-
@Rémy-Verger What program is this anyway? Perhaps you're better off asking them directly for help