How can I start this Node.JS application?
One big part of the Node.Js ecosystem is npm which comes with NodeJS. This is how dependencies are managed.
Many NodeJS programs will have a package.json
file which describes various things about them, like for example what are their dependencies. By running npm install
NPM will look at what packages the program needs, and install them automatically.
You need to install jquery module. 'npm i jquery'.
In node js whenever you use require('module_name')
it will search the node_module folder in your project directory or it can go to the global node_module folder. If the required module is not there, it will give Cannot find module module_name, you can do npm i module_name
to resolve. also, you can save all the required dependencies in package.json folder by using npm i module_name --save
command so that if you need to run the same code on the different environment you do not install each module separately you just need to do npm i
and if will refer package.json folder and install a the dependencies.