Javascript NPM安装错误

Javascript NPM安装错误,javascript,node.js,express,npm,Javascript,Node.js,Express,Npm,我正在尝试让我的应用程序在本地运行。在尝试在文件夹中安装NPM时,我收到一个错误,当它点击到: npm ERR! error installing contextify@0.0.7 我在网上搜索过,但是所有的结果都显示有人在Windows7中出错。我正在使用OSX。我已经安装了XCode 您将在下面找到整个打印输出: gorteks$ npm install npm http GET https://registry.npmjs.org/jquery npm http 304 https://

我正在尝试让我的应用程序在本地运行。在尝试在文件夹中安装NPM时,我收到一个错误,当它点击到:

npm ERR! error installing contextify@0.0.7
我在网上搜索过,但是所有的结果都显示有人在Windows7中出错。我正在使用OSX。我已经安装了XCode

您将在下面找到整个打印输出:

gorteks$ npm install
npm http GET https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/htmlparser
npm WARN htmlparser@1.7.3 package.json: bugs['web'] should probably be bugs['url']
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/contextify

> contextify@0.0.7 preinstall /Users/gorteks/Sites/digidj-app/node_modules/jquery/node_modules/jsdom/node_modules/contextify
> node-waf clean || (exit 0); node-waf configure build

Nothing to clean (project not configured)
Setting srcdir to                        : /Users/gorteks/Sites/digidj-   app/node_modules/jquery/node_modules/jsdom/node_modules/contextify 
Setting blddir to                        : /Users/gorteks/Sites/digidj-app/node_modules/jquery/node_modules/jsdom/node_modules/contextify/build 
Checking for program g++ or c++          : not found 
/Users/gorteks/Sites/digidj-  app/node_modules/jquery/node_modules/jsdom/node_modules/contextify/wscript:11: error: could   not configure a cxx compiler!
npm ERR! error installing contextify@0.0.7
npm ERR! error installing jsdom@0.2.10
npm ERR! error installing jquery@1.6.3
npm ERR! contextify@0.0.7 preinstall: `node-waf clean || (exit 0); node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || (exit 0); 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 || (exit 0); 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 Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/gorteks/Sites/digidj-app
npm ERR! node -v v0.6.7
npm ERR! npm -v 1.1.0-beta-10
npm ERR! code ELIFECYCLE
npm ERR! message contextify@0.0.7 preinstall: `node-waf clean || (exit 0); node-waf       configure build`
npm ERR! message `sh "-c" "node-waf clean || (exit 0); node-waf configure build"` failed   with 1
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/gorteks/Sites/digidj-app/npm-debug.log
npm not ok
谢谢你们的帮助,伙计们

错误:无法配置cxx编译器!

你需要一个C++编译器。您使用的是OSX,因此需要安装XCode

以下是关于这个问题的答案,其中包括针对不同OSs/发行版解决此错误的各种方法:


下载最新版本的Xcode,从4.0升级到4.1

修复!这就是对我有用的东西。 我安装了Lion并更新了XCode。
简单但耗时。

我使用了苹果应用商店的Xcode 4.3,我必须安装Unix命令行工具。这可以通过Xcode->Preferences->Downloads->命令行工具来完成

更新
节点
,更新
npm
,然后重试。如果仍然失败,请向
contextify
I have XCode的作者投诉。忘了提了,我也查过了。我的版本:版本4.0.2d安装时是否选中了“Unix工具”选项?也可以这样看:它太慢了,您现在必须通过应用商店下载XCode。当我尝试时,它说我需要狮子。这太荒谬了。