NPM and jsdom Error Loading - node.js

Getting into the world of node.js. Basically just starting out. I have installed node and got some things working. From my understanding I need to install the module jsdom to get jQuery working. So I downloaded and compiled NPM and when I ran the npm install jsdom command I got back a ton of errors. Here is the printout:
npm WARN htmlparser#1.7.3 package.json: bugs['web'] should probably be bugs['url']
> contextify#0.0.7 preinstall /usr/lib/nodejs/npm/node_modules/jsdom/node_modules/contextify
> node-waf clean || true; node-waf configure build
Nothing to clean (project not configured)
Setting srcdir to : /usr/lib/nodejs/npm/node_modules/jsdom/node_modules/contextify
Setting blddir to : /usr/lib/nodejs/npm/node_modules/jsdom/node_modules/contextify/build
Checking for program g++ or c++ : not found
Checking for program icpc : not found
Checking for program c++ : not found
/usr/lib/nodejs/npm/node_modules/jsdom/node_modules/contextify/wscript:11: error: could not configure a cxx compiler!
npm ERR! error installing contextify#0.0.7 Error: contextify#0.0.7 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing contextify#0.0.7 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing contextify#0.0.7 at ChildProcess.<anonymous> (/usr/lib/nodejs/npm/lib/utils/exec.js:49:20)
npm ERR! error installing contextify#0.0.7 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing contextify#0.0.7 at maybeExit (child_process.js:359:16)
npm ERR! error installing contextify#0.0.7 at Process.onexit (child_process.js:395:5)
npm ERR! error installing jsdom#0.2.10 Error: contextify#0.0.7 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing jsdom#0.2.10 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing jsdom#0.2.10 at ChildProcess.<anonymous> (/usr/lib/nodejs/npm/lib/utils/exec.js:49:20)
npm ERR! error installing jsdom#0.2.10 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing jsdom#0.2.10 at maybeExit (child_process.js:359:16)
npm ERR! error installing jsdom#0.2.10 at Process.onexit (child_process.js:395:5)
npm ERR! contextify#0.0.7 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the contextify#0.0.7 preinstall script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.35-27-virtual
npm ERR! command "node" "/usr/bin/npm" "install" "jsdom"
npm ERR! cwd /usr/lib/nodejs/npm/node_modules
npm ERR! node -v v0.6.2
npm ERR! npm -v 1.0.105
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/lib/nodejs/npm/node_modules/npm-debug.log
npm not ok
It obviously did not work.
Do I need this package to execute jQuery?
What am I doing wrong here?
Thanks.

Checking for program g++ or c++ : not found
You haven't installed the basic stuff needed for compiling things. On Debian and Ubuntu, this should fix it:
sudo apt-get install build-essential
For other distributions, the command is somewhat different, but the basic principle is the same.

Related

How can I install bignum lib for Node.js on Heroku?

I get the following error
-----> Installing dependencies with npm
> bignum#0.5.1 install /tmp/build_1xz3suiyqvjwh/node_modules/bignum
> node-gyp configure build
sh: node-gyp: not found
npm ERR! error installing bignum#0.5.1 Error: bignum#0.5.1 install: `node-gyp configure build`
npm ERR! error installing bignum#0.5.1 `sh "-c" "node-gyp configure build"` failed with 127
npm ERR! error installing bignum#0.5.1 at ChildProcess.<anonymous> (/tmp/node-npm-Pi2L/lib/utils/exec.js:49:20)
npm ERR! error installing bignum#0.5.1 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing bignum#0.5.1 at maybeExit (child_process.js:358:16)
npm ERR! error installing bignum#0.5.1 at Process.onexit (child_process.js:394:5)
npm ERR! bignum#0.5.1 install: `node-gyp configure build`
npm ERR! `sh "-c" "node-gyp configure build"` failed with 127
npm ERR!
npm ERR! Failed at the bignum#0.5.1 install script.
npm ERR! This is most likely a problem with the bignum package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bignum
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.32-343-ec2
npm ERR! command "/tmp/node-node-8eWj/bin/node" "/tmp/node-npm-Pi2L/cli.js" "install" "--production"
npm ERR! cwd /tmp/build_1xz3suiyqvjwh
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_1xz3suiyqvjwh/npm-debug.log
npm not ok
! Failed to install --production dependencies with npm
! Heroku push rejected, failed to compile Node.js app

node-qrcode install on heroku

I got problem to install this package on heroku.
Is there a way to do it ?
I saw it's a problem with canvas module, but i don't know what to do.
This is a log of installation on heroku. I don't know how to get more :
npm ERR! canvas#0.12.1 preinstall: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the canvas#0.12.1 preinstall script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-343-ec2
npm ERR! command "/tmp/node-node-La1F/bin/node" "/tmp/node-npm-6Xts/cli.js" "install" "--production"
npm ERR! cwd /tmp/build_3ejt8evom1p0g
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.41
npm ERR! code ELIFECYCLE
npm ERR! stack Error: canvas#0.12.1 preinstall: `node-waf configure build`
npm ERR! stack `sh "-c" "node-waf configure build"` failed with 1
npm ERR! stack at ChildProcess.<anonymous> (/tmp/node-npm-6Xts/lib/utils/exec.js:56:20)
npm ERR! stack at ChildProcess.emit (events.js:70:17)
npm ERR! stack at maybeExit (child_process.js:362:16)
npm ERR! stack at Process.onexit (child_process.js:398:5)
I successfully used this Heroku builpack:
https://elements.heroku.com/buildpacks/mojodna/heroku-buildpack-cairo
But in its README, it tells you to use heroku-buildpack-multi, that's deprecated. What I did was, using Heroku Toolbelt in command line:
heroku buildpacks:set --index 1 https://github.com/mojodna/heroku-buildpack-cairo.git
heroku buildpacks:add heroku/nodejs
And then push to Heroku so it can build packages again.

npm install sqlite3 error

i am not sure why, but i am having issues while installing any of the packages using npm. i tried to install sqlite3 and it gave error as follows:
naphstor#ubuntu:~$ sudo npm install sqlite3
[sudo] password for naphstor:
> sqlite3#2.0.15 preinstall /home/naphstor/node_modules/sqlite3
> node-waf clean || true; node-waf configure build
Nothing to clean (project not configured)
Setting srcdir to : /home/naphstor/node_modules/sqlite3
Setting blddir to : /home/naphstor/node_modules/sqlite3/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for sqlite3 : not found
Checking for library sqlite3 : not found
/home/naphstor/node_modules/sqlite3/wscript:29: error: the configuration failed (see '/home/naphstor/node_modules/sqlite3/build/config.log')
npm ERR! error installing sqlite3#2.0.15 Error: sqlite3#2.0.15 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing sqlite3#2.0.15 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing sqlite3#2.0.15 at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing sqlite3#2.0.15 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing sqlite3#2.0.15 at maybeExit (child_process.js:359:16)
npm ERR! error installing sqlite3#2.0.15 at Process.onexit (child_process.js:395:5)
npm ERR! sqlite3#2.0.15 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the sqlite3#2.0.15 preinstall script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.0.0-12-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "sqlite3"
npm ERR! cwd /home/naphstor
npm ERR! node -v v0.5.11-pre
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/naphstor/npm-debug.log
npm not ok
naphstor#ubuntu:~$
any idea why is it like that. it shows same kind of error in installing any of the other packages.
I can do it with a workaround like "git clone git://github.com/developmentseed/node-sqlite3.git" but was wondering why npm gives error while installing any of these packages.
This can be fixed by forcing SQLite3 to compile.
npm install sqlite3 --build-from-source
Make sure you have these following dependencies installed
python-software-properties
python
g++
make
build-essential
or run sudo npm install -g node-gyp
You will find more informations there (SQlite3 section):
http://support.ghost.org/troubleshooting/
Node version can be the issue, so for node 10.x and later, just install sqlite3#4.1.1, as in specify the version
Try updating npm. I just tested it with the latest version, and it worked.
Alternatively, try one of these packages:
https://github.com/grumdrig/node-sqlite
https://github.com/orlandov/node-sqlite
I faced this problem as well then i removed node js what i downloaded and installed from ubuntu repos and downloaded source code from official node js site and compiled after it again tried to install sqlite without problem it worked i advise u to update your node and npm version as well
It was a permissions problem for me. I was seeing this line before the errors:
gyp WARN EACCES current user ("ubuntu") does not have permission to access the dev dir "/root/.cache/node-gyp/14.15.4"
So I did chmod -R 777 /root then npm i sqlite3.

nowjs/node-proxy fails to install on ubuntu 11.10

I'm trying to install now.js on ubuntu 11.10 (running on windows with wubi, if that matters). I've downloaded and installed node, npm, and socket.io just fine, but sudo npm install now fails for some reason. I've tried with and without sudo, tried installing it globally, same error. Make is installed just fine...is it some problem with the node-proxy package? For what it's worth, trying npm install node-proxy produces a similar error.
node version 0.6.2
npm version 1.0.106
ubuntu 11.10 (windows with wubi)
The log reads, when I try to install now:
npm WARN node-proxy#0.5.2 package.json: bugs['web'] should probably be bugs['url']
> node-proxy#0.5.2 install /home/my_name/node_modules/now/node_modules/node-proxy
> make
BUILDING: C++ Component
/bin/sh: node-waf: not found
cp: cannot stat `src/build/*/node-proxy.node': No such file or directory
make: *** [all] Error 1
npm ERR! error installing node-proxy#0.5.2 Error: node-proxy#0.5.2 install: `make`
npm ERR! error installing node-proxy#0.5.2 `sh "-c" "make"` failed with 2
npm ERR! error installing node-proxy#0.5.2 at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing node-proxy#0.5.2 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing node-proxy#0.5.2 at maybeExit (child_process.js:359:16)
npm ERR! error installing node-proxy#0.5.2 at Process.onexit (child_process.js:395:5)
npm ERR! error installing now#0.7.6 Error: node-proxy#0.5.2 install: `make`
npm ERR! error installing now#0.7.6 `sh "-c" "make"` failed with 2
npm ERR! error installing now#0.7.6 at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing now#0.7.6 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing now#0.7.6 at maybeExit (child_process.js:359:16)
npm ERR! error installing now#0.7.6 at Process.onexit (child_process.js:395:5)
npm ERR! node-proxy#0.5.2 install: `make`
npm ERR! `sh "-c" "make"` failed with 2
npm ERR!
npm ERR! Failed at the node-proxy#0.5.2 install script.
npm ERR! This is most likely a problem with the node-proxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make
npm ERR! You can get their info via:
npm ERR! npm owner ls node-proxy
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.0.0-13-generic
npm ERR! command "node" "/usr/bin/npm" "install" "now"
npm ERR! cwd /home/my_name
npm ERR! node -v v0.6.2
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/my_name/npm-debug.log
npm not ok
The issue appears to be that node-waf is missing.
node-waf is a tool that is included with node which allows compiling binary modules, such as node-proxy.
You can test to see if node-waf is available simply by typing node-waf into the terminal to see if the command can be found. If not, you will need to reinstall node (run make install again) to make sure node-waf is available.

npm install PDFkit fails

I'm trying to install PDFKit for node.js using the recommended command:
npm install pdfkit
However it fails with the following messages:
zlib#1.0.5 preinstall /home/woody/node_modules/pdfkit/node_modules/zlib
node-waf clean || true; node-waf configure build
sh: node-waf: not found
sh: node-waf: not found
npm ERR! error installing zlib#1.0.5 Error: zlib#1.0.5 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing zlib#1.0.5 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127
npm ERR! error installing zlib#1.0.5 at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing zlib#1.0.5 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing zlib#1.0.5 at ChildProcess.onexit (child_process.js:192:12)
npm ERR! error installing pdfkit#0.1.5 Error: zlib#1.0.5 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing pdfkit#0.1.5 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127
npm ERR! error installing pdfkit#0.1.5 at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing pdfkit#0.1.5 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing pdfkit#0.1.5 at ChildProcess.onexit (child_process.js:192:12)
npm ERR! zlib#1.0.5 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127
npm ERR!
npm ERR! Failed at the zlib#1.0.5 preinstall script.
npm ERR! This is most likely a problem with the zlib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls zlib
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.32-33-generic-pae
npm ERR! command "node" "/usr/bin/npm" "install" "pdfkit"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/woody/npm-debug.log
npm not ok
I'm running Ubuntu 10.04.3 LTS
If anyone has any help or suggestions, that'd be great - thanks.
You need install nodejs-dev package:
sudo apt-get install nodejs-dev

Resources