I have some module in my node_module folder but because I am amateur in nodejs
, when I wanted to install theme, I forgot to use --save
with npm install
.now I have lots of module but my package.json
is empty so is there any way to add theme into package.json
.
Sorry if my question is silly one I am beginner in nodejs
You can add dependencies to a package. json file from the command line or by manually editing the package.
On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you set the NODE_PATH environment variable to this path, the modules can be found by node.
Simply change into the directory containing node_modules
, backup any existing package.json
in there, then use npm init
to re-create the package.json
.
The generated package.json
will include any modules that already exist within node_modules
.
Sample run:
$ cd /my/project
$ mv package.json package.json.bak # Backup package.json
$ npm init # Recreate package.json with dependencies populated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With