By default, my scripts are placed in the folder

/root/script-server.js.

And I put it here

/var/www/****/data/nodeserver/message.js

Two questions: How to make the new path become the default? Why the error comes out

cannot fint module 'socket.io'

when I put a new path. What socket.io doesn't like?

    1 answer 1

    Try writing in the linux console:

     export NODE_PATH /var/www/****/data/nodeserver 

    before running your application

    • bash export not a valid identifier - Adel