How to edit files of Node Modules?


#1

I can’t edit files of node modules because it doesn’t appear to me. I want to edit this file https://i.imgur.com/JqSQRpP.png


Accesing files that dont show up
#2

Yeah, we’ve discussed making node_modules accessible in some way. For now, you can edit it from the console using nano, which is accessible under advanced options from the top-left project info menu.


#3

Can you give me more details of how to do it please?


#4

Sure, you’ll want to move into the lib directory using cd node_modules/spotify-web/lib in the Glitch console. Then open spotify.js with nano to edit it by running nano spotify.js. Make your edits, then press ctrl+x to exit nano and you’ll be prompted to save the file.


#5

Ok! Thanks it worked.


#6

not working for me help me


#7

This is an old thread and we’ve since made changes which mean this approach doesn’t work unless you run enable-npm from the command line to use the npm package manager. Note though that doing that will mean your node modules will begin to use up project disk space so you’ll likely to run out of space.

If you want to do it with pnpm, our default package manager, it’s a little more complicated - this post provides a good overview of how to do it: Default Node-red flow and pnpm