Install node.js modules in eclipse - node.js

I am trying to develop a chat app with node.js and socket.io in an eclipse environment. I have installed node.js in eclipse but I don't know how to install node modules such as expresss, socket io, etc.
Please anyone tell me how to setup node modules in an eclipse environment.

From https://groups.google.com/forum/#!topic/nodeclipse/FgUci2ZXpoQ
Double-click package.json on the Package Explorer to open it.
Add into dependencies section what you want to install, and save it.
Select package.json on the Package Explorer, open context menu by right-clicking, and select [Run As]-[npm install] menu.

I dont think that there is an eclipse integrated way to do this. My suggestion is that you download node.js+npm from http://nodejs.org/download/ and then open up a terminal/cmd and in your node.js project directory do "npm install myPackage"

I'm running Eclipse Mars... Here is how I did it...
Install Nodeclipse from eclipse marketplace http://www.nodeclipse.org/
Create a new node.js express project, File -> New Node.Js Express Project
Open the package.json file
Add my npm package to the package.json as a dependency (copy the format for the express dependency)
Save the package.json (seems obvious but it got me when testing!)
Right click the package.json, Run As -> NPM Install
Right click the eclipse project folder, Refresh
Open node_modules... BOOM! You will see your new module installed in eclipse

You mention installing express, but you don't need to install that if you're using nodeclipse.
to generate an express project:
Select the File-New-Project menu.
Select Node-Express Project, and select Next button.
Enter Project name and select Finish button.

To install express modules in Nodeclipse go to
Windows -> Preferences-> Nodeclipse -> choose express path field
and enter the location of the installed express on your localhost.

Navigate to your project folder via command prompt. Once there, run the npm install 'module' command. After the module installs, refresh your project in eclipse. A javascript library should show up in your project containing the library of the module you just installed. Run your code and it should work and recognize the modules that your are trying to require.
Hope this helps.

Related

NPM not installing node module

I have an angular project that comes with a package.json file and all the dependencies listed within, but each time I run "npm install", in the terminal, the packages appear to be downloading properly and a node module folder is created in my root folder, but at a certain stage the installation stops without an error message and the generated node module folder disappear from my project. please what do I do?
I can't reproduce your situation, somehow this may not fitable for you.
But I suggest re-install node.js to make sure npm install work correctly.
This link will help to find what version of node.js for you, based on you angular version.
Compatibility list for Angular/Angular-CLI and Node.js
Also, It would be good to manage node.js via NVM(Node Version Manager).

WebStorm error: Cannot install Node.js module: please specify default Node.js interpreter

When I click on Install 'mdbvue'
the following error appears in WebStorm:
I looked at this thread and it says that I have to set the right Run Configurations.
So I checked the path to node using which node in the terminal:
Then, I changed the path in the Run/Debug Configurations for npm and Node.js to:
But it still doesn't work.
What am I doing wrong?
Go Webstorm preferences (CMD + , on mac), then choose node.js and npm
choose the node version that is installed on ur machine. I have NVM, so I choose version that are installed using NVM (easy to manage different node versions)
Fixing the package.json solved the issue

How to use npm package in nw.js without installing Node JS

I want to use this npm package(https://www.npmjs.com/package/node-ssh) in my nw.js application,
In my dev system installed node js and installed this package and successfully its working
, But while shipping this application I don't want to make a dependency to node js. Without installing the node js can nw.js use this package.
Any help ?
Use Gradle wrapper and the Gradle Plugin for Node.
To avoid having to install gradle, I use Spring Initializr to create a simple project that has the gradle wrapper in it. Then I'll just copy the gradle folder, the gradlew and gradlew.bat. All that's left then is to create the .gitignore and build.gradle files.

Can't install bootstrap using npm

I can't install bootstrap using node package manager console.
There are some errors showing in the console.
Can I use only a CDN to my website or is it required to install bootstrap by npm?.
You are trying to install bootstrap inside a directory named bootstrap that is why it gave you this error. just change directory name and install it
"Did you name your project the same as the dependency you're installing?"
Fix would be renaming your project folder from bootstrap-3.3.7 to any.
change the parent directory and then install.
and better start using Bootstrap 4. It is new and much better.

Visual studio scaffold nodejs missing all modules?

I used visual studio to create an node express 4 project. However it cannot run and all the entries under npm show (missing). I cannot find the node_modules folder too.
It doesn't install them automatically. Either run npm install from a command window, or right click on the "npm" item in the project structure and do the install that way. I would recommend doing it through the command prompt though, if you are on a 64 bit machine.

Resources