miroslavpejic85/mirotalksfu

How to access node_modules or install additional modules?

Kareszrk opened this issue · 2 comments

Dear Developer,

I would like to kindly ask you about how I am able to access the node_modules folder?

I wanted to install nodemon, and start development with it (first of all put the entire conference system behind a login system of mine) but that would require me to have a usable development enviorement, which is causing the need of nodemon for me, also I need additional modules being installed, but without having a node_modules folder, and package.json is providing problems when executing npm install in the main folder, I cannot do my own developments.

The error message which is popping up when I try to execute npm install in the main folder is as follows:
`root@vmi530479:/var/www/ChatPlatform# npm install

npm ERR! code 1
npm ERR! path /var/www/ChatPlatform/node_modules/mediasoup
npm ERR! command failed
npm ERR! command sh -c node npm-scripts.js postinstall
npm ERR! npm-scripts.js [INFO] running task "postinstall"
npm ERR! npm-scripts.js [INFO] buildWorker()
npm ERR! npm-scripts.js [INFO] executeCmd(): make -C worker
npm ERR! make: Entering directory '/var/www/ChatPlatform/node_modules/mediasoup/worker'
npm ERR! # Updated pip and setuptools are needed for meson.
npm ERR! # --system is not present everywhere and is only needed as workaround for
npm ERR! # Debian-specific issue (copied from gluster/gstatus#33),
npm ERR! # fallback to command without --system if the first one fails.
npm ERR! /usr/bin/python3 -m pip install --system --target=/var/www/ChatPlatform/node_modules/mediasoup/worker/out/pip pip setuptools ||
npm ERR! /usr/bin/python3 -m pip install --target=/var/www/ChatPlatform/node_modules/mediasoup/worker/out/pip pip setuptools ||
npm ERR! echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"
npm ERR! Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package
npm ERR! # Install meson and ninja using pip into custom location, so we don't
npm ERR! # depend on system-wide installation.
npm ERR! /usr/bin/python3 -m pip install --upgrade --target=/var/www/ChatPlatform/node_modules/mediasoup/worker/out/pip meson==0.61.5 ninja==1.10.2.4
npm ERR! make: Leaving directory '/var/www/ChatPlatform/node_modules/mediasoup/worker'
npm ERR! /usr/bin/python3: No module named pip
npm ERR! /usr/bin/python3: No module named pip
npm ERR! /usr/bin/python3: No module named pip
npm ERR! make: *** [Makefile:101: meson-ninja] Error 1
npm ERR! npm-scripts.js [ERROR] executeCmd() failed, exiting: Error: Command failed: make -C worker

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-05-18T07_49_10_187Z-debug-0.log`

If you could help me solve this case, I would be greateful!

Hello @Kareszrk,

Just running num install is not enough, first you must install all necessary dependencies as specified in the readme.

# Gcc g++ make
$ apt-get update
$ apt-get install -y build-essential
# Python 3.8 and pip
$ DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
$ apt install -y software-properties-common
$ add-apt-repository ppa:deadsnakes/ppa
$ apt update
$ apt install -y python3.8 python3-pip
# NodeJS 16.X and npm
$ apt install -y curl dirmngr apt-transport-https lsb-release ca-certificates
$ curl -sL https://deb.nodesource.com/setup_16.x | bash -
$ apt-get install -y nodejs
$ npm install -g npm@latest

Check also the docs provided on how to self-host it here.

Please for questions use the forum - help & support channel, instead to open issue here, that is mainly for confirmed bug or eventually futures requests that also can be discussed before, all togheter, in the channel ideas and suggestions.

Thank you for understanding.

Thank you! It looks like it is working, I have a last question about this.
When I now try to execute nodemon, it returns the following:
[nodemon] 2.0.22
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node Server.js
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module '/var/www/ChatPlatform/Server.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
[nodemon] app crashed - waiting for file changes before starting...

Can you help me with this, on how to tell the (package.json I guess) how to start the server, please?