Is it possible to add node_modules

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?


we have an “add package” menu you can use when you’re looking at a project’s package.json:

Hope that’s useful for adding modules!

1 Like

I fixed it, I changed my node version but thanks anyways!

1 Like

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

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

  1. node_modules is in the project
  2. it is hidden by the global glitch gitignore
  3. you can access it by cding to it in console ( cd ~/node_modules in a nodejs project )
  4. 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.
1 Like