Ошибка загрузки NPM и JSDOM - PullRequest
3 голосов
/ 13 января 2012

Знакомство с миром node.js. В основном только начинается. Я установил узел и получил некоторые вещи, работающие. Насколько я понимаю, мне нужно установить модуль jsdom, чтобы заставить работать jQuery. Поэтому я скачал и скомпилировал NPM, и когда я выполнил команду npm install jsdom, я получил массу ошибок. Вот распечатка:

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

Это явно не сработало.

  1. Нужен ли этот пакет для выполнения jQuery?
  2. Что я здесь не так делаю?

Спасибо.

1 Ответ

1 голос
/ 14 января 2012
Checking for program g++ or c++          : not found

Вы не установили базовый материал, необходимый для компиляции. В Debian и Ubuntu это должно исправить:

sudo apt-get install build-essential

Для других дистрибутивов команда несколько иная, но основной принцип тот же.

...