Hi, is it possible to add my node_modules to Glitch? Because I keep getting this message when I try a command
I believe there already is a node_modules folder on glitch. Have you tried installing again?
hello,
we have an âadd packageâ menu you can use when youâre looking at a projectâs package.json
: https://glitch.com/help/how-do-i-add-an-npm-module-package-to-my-project/
Hope thatâs useful for adding modules!
I fixed it, I changed my node version but thanks anyways!
It seems this Issue May be resolved but
for anyone who is reading this Because they are having issues i am Gonna be a Bit detailed
If you are Using Javascript you need to ensure you state your Modules in a Package.json
and set some code stating What Modules your Project needs to function in the code of Every Javascript file (You just need to place what Modules you are using in the code of the Javascript File but sometimes it may not need to be done
E.g you may not need to Place FFMPEG in a Discord botâs Javascript code file but
You need to State a Code Library Like Discord.js
An Example of Code could be this:
const DBM = {};
const DiscordJS = DBM.DiscordJS = require(âdiscord.jsâ);
const express = require(âexpressâ);
const keepalive = require(âexpress-glitch-keepaliveâ);
const app = express();
My bot project Uses FFMPEG however it is NOT a Library
But DIscord.js is so it needs to be stated in a Javascript file
and like @Maxxx0901 Has said with fixed this issues
The Node Version You use Can also Affect it
TL;DR:
Coding Libraries need to Stated in Javascript code
Encoders Like FFMPEG, Opuss Do not need to be Stated in code just in your package.json
You need to state all node modules your project needs in the Package.json file
If i am Wrong in anything or you need me to clarify anything
Please Kindly let me know
i Hope i Helped
Also Grammar Nuts i know i am missing Punctuation
- node_modules is in the project
- it is hidden by the global glitch gitignore
- you can access it by cding to it in console (
cd ~/node_modules
in a nodejs project ) - ffmpeg, i donât know, i heard there is an alternative package for it, but if not, you can just cd to the node modules ( see above) and download it from github or whatever.