首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NPM和jsdom错误加载

NPM和jsdom错误加载
EN

Stack Overflow用户
提问于 2012-01-13 18:49:07
回答 1查看 1.4K关注 0票数 3

进入node.js的世界。基本上才刚开始。我安装了节点,并使一些东西正常工作。据我理解,我需要安装模块jsdom才能使jQuery工作。所以我下载并编译了NPM,当我运行命令时,我得到了大量错误。这是打印出来的:

代码语言:javascript
复制
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. 我在这里做错了什么?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2012-01-13 20:14:11

代码语言:javascript
复制
Checking for program g++ or c++          : not found

您还没有安装编译所需的基本内容。在Debian和Ubuntu上,这应该可以修复它:

代码语言:javascript
复制
sudo apt-get install build-essential

对于其他发行版,命令有些不同,但基本原则是相同的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8855609

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档