Ошибка установки NPM - PullRequest
       27

Ошибка установки NPM

3 голосов
/ 13 января 2012

Я пытаюсь заставить мое приложение работать локально.При попытке установить 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

Спасибо за вашу помощь, ребята!

Ответы [ 4 ]

4 голосов
/ 27 февраля 2012

Я использовал Xcode 4.3 из Apple App Store, и мне пришлось установить инструменты командной строки Unix.Это можно сделать через XCode -> Настройки -> Загрузки -> Инструменты командной строки

2 голосов
/ 13 января 2012

"ошибка: не удалось настроить компилятор cxx!"

Вам нужен компилятор C ++. Вы используете OSX, поэтому вам нужно установить XCode.

Вот SO-ответ по этому вопросу, который включает различные способы решения этой ошибки для разных ОС / дистрибутивов:

Как скомпилировать / установить node.js (не удалось настроить компилятор cxx!) (Ubuntu).

0 голосов
/ 25 января 2012

ИСПРАВЛЕНО!Вот что сработало для меня.Я установил Lion и обновил XCode.Простой, но трудоемкий.

0 голосов
/ 13 января 2012

скачайте последнюю версию Xcode, обновитесь с 4.0 до 4.1

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...