Add a warning that node_modules folder is inaccessible

Describe your feature request
A warning that node_modules is inaccessible if you try to move/copy/etc a file into ~/node_modules.

What problem(s) would this feature solve?
The inability to recover files that are moved into node_modules.

Explain what you were trying to do when you came across the problem leading to this feature request
I was looking for a way to hide sensitive information (api keys, etc). The secrets feature doesn’t seem to be allowed on static projects. I saw another suggestion to move the file into the node_modules folder, so I did. Now I can’t access the file anymore.

$ mv bookie.js node_modules
$ ls -h
bookie.js.template  gitignore  index.html  node_modules  replit.nix  script.js  style.css
$ cd node_modules
bash: cd: node_modules: Not a directory
$ ls -h
bookie.js.template  gitignore  index.html  node_modules  replit.nix  script.js  style.css
$ cd .node_modules
bash: cd: node_modules: Not a directory

Yes the secrets feature isn’t available on static projects. An easy fix is to use NodeJS. I don’t know JS very well, but I was able to use it like I would any static HTML project. I just used a template, and then in the public folder where index.html was I created other HTML files, JS, and CSS and it worked like a static HTML page. Ultimately this is a poor use of NodeJS, but if it works for your purposes, then you should do it. That’s what I did.
On a side note, what happens when you run cat node_modules? Maybe it’s a file somehow?

2 Likes

Thanks @anon40284853 !!!

That gave me my file! Yay, I guess it is a file. So when I moved the file into node_modules, it just tacked the content of bookie.js into node_modules file?

1 Like

I don’t know why it did that, but I’m glad that it worked :slightly_smiling_face:. If this solved your problem, please mark it as solved.

It’s because the mv command is used for moving files and also renaming. If it can’t find the target directory, it just renames the file instead.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.