Node.js can't find module ibm_db - node.js

Sorry for yet another nube question but I haven't touched JS in years..
I'm confused with node.js, npm ls -g --depth 0 clearly shows ibm_db listed and yet a
var ibmdb = require('ibm_db')
from within a node cli,
errors with can't find module ibm_db.
Netbeans search found the Node.js files without issue..
I know it's going to be something annoyingly obvious, but just can't see it.
OS is ubuntu server..
I've tried 3 install commands:
As User-
npm install ibm_db
npm install -g ibm_db
As root-
npm install -g ibm_db
DB2CLI is working correctly.
Anyone any ideas?

Related

'express' is not executable

This is quite basic. Many examples show terminal commands such as: 'express name-of-directory-to-be-created'. Yet on my system, though I've installed node.js (and command: node -v works, and npm -v works), command: express fails with: command not found Further investigation shows that, on my macbook air, all incidences of express.js are not executable. I believe express was installed using npm express or npm -g express. Please, what is going on? Are the examples correct? ( There are several, all from various sources. ) How may I execute
express directory
Thanks in advance.
This usually happens on windows.
You need to install express globally and the location where npm modules get installed should be added to PATH(environment variable).
To install express globally type npm install -g express
Also it looks like you are trying to use express-generator.If yes you should install it similarly.
npm install -g express-generator
In windows by default npm modules are installed at "C:\Users\u_name\AppData\Roaming\npm"
Edit your PATH environment variable and append your npm path at the end.

I can't install npm not matter what I do

So I'm trying to get myself a good Discord Selfbot and one of them requires nodejs, then it said to do npm install. But it gave me an error. I tried again again again and again but nothing worked. The latest thing I did was installing nodejs via scoop but I get this error trying to install npm. Is there a way to do this manually or something? I've tried installing different versions but nothing. I believe scoop installed the latest version.
Here's the image. (the red squares cover up just names)
You have npm already installed, seems that the problem is you don't have a package.json in that location. It says ENOENT: No such file or directory
You already have npm installed! npm is a package manager for installing nodejs packages. Try running some nonsense command (like "lkajshdflhsf") and you'll see what it looks like if you actually didn't have npm installed. What npm install does is install some package. So, for example, if you want to install a node package called Blah, you would run npm intall blah.

express command is not working in ubuntu 14.04 LTS terminal

First thing I want to clear here that may be this question is duplicate.But I read all the question related on this topic in stack overflow but not got the solution.
Please Help me. I just install Nodejs version in my Laptop on Ubuntu OS.For ensure that nodejs is install on my laptop, Using node -v I found the version of Node js which is 0.12.2
and same for npm I follow same steps and it works for me.But when i install ' express 4 version'. I use which node command and it is working and show the path is /usr/bin/node and same for npm is /usr/bin/npm.
but when i check for express it is not working for me. I have number of time install express-generator using 'sudo npm install -g express-generator' and it install the files but when I use express my_app command it print The program 'express' is currently not installed. You can install it by typing:
sudo apt-get install node-express
Run:
npm install -g express
In most cases you do not need sudo.

npm module Imager installation

I have been trying to install npm package because for some odd reason the module and GraphicsMagick library vanished into thin air from my machine(but that is a discussion for some other day).
Now I have installed the library but when I run
sudo npm install --save imager
I get a long list of errors. starting from
Error: ENOENT, lstat '/home/user/Desktop/project/node_modules/imager/node_modules/pkgcloud/node_modules/request/node_modules/json-stringify-safe/LICENSE'
any help would be appreciated.
Many npm modules are skins over previously written native code projects.
In this case : GraphicsMagick
If you first do the install of GraphicsMagick (outside of node/npm) or whichever is the underlying project. Get it up and running and only then do the npm install of its skin it will work. I just did these steps on ubuntu for npm module imager and the install worked fine.
Understand the meaning of npm install with a -g flag (global) - If the module makes available a command line executable then do npm install -g xxxx

NPM appears to do nothing on Linux Mint 15

searched, and did not see this specific problem.
Trying to get a MEAN stack built on my Linux Mint machine, and bumping into a bit of an unusual issue.
Got MongoDB installed, and finally got it running correctly (none of the instructions ANYWHERE mentioned having to create the /data/db/ directory and set permissions, go figure).... it works now.
Got NodeJS installed, and it appears to work correctly.
I had been told (apparently incorrectly) that NPM installs right alongside Node, with:
sudo apt-get install nodejs
but:
$ npm
bash: /usr/bin/npm: No such file or directory
So I go ahead and install NPM separately.
$ sudo apt-get install npm
Seems to work, so far, no errors, and it looks like it is pulling down the NPM package and installing it...
$ nodejs -v
v0.10.21
$ npm -v
$
?? It simply fails to respond without any error... so I try:
$ npm install grunt -g --save-dev
$
Same completely silent failure... in fact, NOTHING I could do gets a response out of NPM.
Looked all over the web, and saw nothing similar anywhere... found out that NPM holds its cache files in ~/.npm and noticed that this folder didn't exist (kinda like the mongo issue above), so I created it, and set permissions to 7777... still nothing.
Purged and re-installed both node and npm, tried installing them both together and separately (yes, desperation)... still no love.
WTF am I doing wrong?
I would love, eventually, to have a nice development environment setup, hopefully with Cloud9 as a local IDE.... but already pulling my hair out.
=========================================================================================
OK, after a few more headaches, this is up and built now... thank you all.
Would love to mark both as answers, but it won't let me.
npm does come with node. Where is apt-get pulling it from? I install the Mac OS X packages on my Mac for development and npm does in fact come with it. I compile from source on my CentOS server and npm comes with it.
Your package provider may be providing them separately as a (in)convenience to you.
As for why your npm command does not work after installation, I can't say for sure, but I am suspicious of your use of --save-dev and -g together.
-g means to install globally, which means 2 things:
It will be installed outside of your npm package's structure into a system location like /usr/bin or /usr/local/bin
It requires root access to install. Did you use sudo to run it with root access?
Both of those requirements conflict with --save-dev which records the package as a dependency in your package.json file so that future npm install commands will install that package within the project space.
That said, I happen to know a lot about grunt. It has 2 parts, a globally installed tool and the package-specific tool. The correct way to install it is:
$ [sudo] npm install -g grunt-cli
$ npm install grunt --save-dev
This will install the grunt-cli package into a system location guaranteed to be in the $PATH, which turns around and looks for a package-specific grunt installed which is not system-wide.
When installing nodejs with npm, this one-liner worked for me.
sudo apt-get install nodejs nodejs-dev npm
I don't believe npm comes with the nodejs installation in the apt repo. Try to install npm separately using the following tutorial http://www.giantflyingsaucer.com/blog/?p=1688 'To install NPM ....'
====== Edit ====
node and npm IS separate. Follow the official wiki and everything should be fine

Resources