Не удается установить модуль node-sass npm

Я пытаюсь установить модуль npm «node-sass» в своем дистрибутиве Ubuntu 14.04.

Когда я бегу

node -v

я получил

v0.10.32

Однако при попытке установить node-sass и harp с помощью этой команды:

sudo npm install -g harp

Я получаю следующую ошибку:

child_process: customFds option is deprecated, use stdio instead.
gyp ERR! configure error 
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack     at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack     at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:722:7)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at maybeClose (child_process.js:999:16)
gyp ERR! stack     at Socket.<anonymous> (child_process.js:1167:11)
gyp ERR! stack     at Socket.emit (events.js:107:17)
gyp ERR! stack     at Pipe.close (net.js:461:12)
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/harp/node_modules/terraform/node_modules/node-sass
gyp ERR! node -v v0.13.0-pre
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 
Build failed
npm ERR! [email protected] install: `node build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "harp"
npm ERR! cwd /home/colin
npm ERR! node -v v0.13.0-pre
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/colin/npm-debug.log
npm ERR! not ok code 0

Обратите внимание, что в сообщении об ошибке указано, что моя версия узла по-прежнему v0.13.0-pre, хотя я переключился на 0.10.32 с nvm.


person user3172050    schedule 25.09.2014    source источник
comment
Похоже, что узел не установлен в каталоге, в котором его ищет node-sass. Попробуйте запустить which node, я верю, что он должен вернуть /usr/bin/node   -  person James Harrington    schedule 22.01.2015
comment
К сожалению, вы немного опоздали на вечеринку, так как я фактически заменил свой компьютер и удалил Ubuntu в пользу OSX, но я почти уверен, что which node вернул /usr/local/bin/node.   -  person user3172050    schedule 23.01.2015
comment
я тоже получаю подобную ошибку. кто-нибудь какое-нибудь обновление?   -  person PBDesk    schedule 03.11.2016


Ответы (1)


Вопросу 3 года, но недавно я столкнулся с той же проблемой на osx, пытаясь установить harp, и не нашел решения в другом месте.

После нескольких попыток удалось решить проблему с модификатором --unsafe-perm, например: sudo npm install --global --unsafe-perm harp

Установка прошла успешно и все работает, надеюсь поможет :)

person Maciej Kwas    schedule 04.11.2017