进入node.js的世界。基本上才刚开始。我安装了节点,并使一些东西正常工作。据我理解,我需要安装模块jsdom才能使jQuery工作。所以我下载并编译了NPM,当我运行命令时,我得到了大量错误。这是打印出来的:
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显然不起作用。
谢谢。
发布于 2012-01-13 20:14:11
Checking for program g++ or c++ : not found您还没有安装编译所需的基本内容。在Debian和Ubuntu上,这应该可以修复它:
sudo apt-get install build-essential对于其他发行版,命令有些不同,但基本原则是相同的。
https://stackoverflow.com/questions/8855609
复制相似问题