2015-10-06 3 views
0

Я просто попытался создать основное приложение чата, используя следующую инструкцию http://socket.io/get-started/chat/.Основное приложение чата Создание с использованием Socket.io и узла js

Когда я попытался запустить npm install --save socket.io

Я получаю следующее сообщение об ошибке. Как решить эту проблему:

npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 
npm WARN package.json [email protected] No license field. 

> [email protected] install /root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil 
> node-gyp rebuild 

make: Entering directory `/root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build' 
    CXX(target) Release/obj.target/bufferutil/src/bufferutil.o 
make: g++: Command not found 
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 127 
make: Leaving directory `/root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build' 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) 
gyp ERR! stack  at ChildProcess.emit (events.js:110:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:1074:12) 
gyp ERR! System Linux 3.13.0-55-generic 
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
cwd /root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil 
gyp ERR! node -v v0.12.7 
gyp ERR! node-gyp -v v2.0.1 
gyp ERR! not ok 

> [email protected] install /root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate 
> node-gyp rebuild 

make: Entering directory `/root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build' 
    CXX(target) Release/obj.target/validation/src/validation.o 
make: g++: Command not found 
make: *** [Release/obj.target/validation/src/validation.o] Error 127 
make: Leaving directory `/root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build' 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) 
gyp ERR! stack  at ChildProcess.emit (events.js:110:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:1074:12) 
gyp ERR! System Linux 3.13.0-55-generic 
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /root/chat-example/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate 
gyp ERR! node -v v0.12.7 
gyp ERR! node-gyp -v v2.0.1 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 

> [email protected] install /root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate 
> node-gyp rebuild 

make: Entering directory `/root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build' 
    CXX(target) Release/obj.target/validation/src/validation.o 
make: g++: Command not found 
make: *** [Release/obj.target/validation/src/validation.o] Error 127 
make: Leaving directory `/root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build' 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) 
gyp ERR! stack  at ChildProcess.emit (events.js:110:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:1074:12) 
gyp ERR! System Linux 3.13.0-55-generic 
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate 
gyp ERR! node -v v0.12.7 
gyp ERR! node-gyp -v v2.0.1 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 

> [email protected] install /root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil 
> node-gyp rebuild 

make: Entering directory `/root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build' 
    CXX(target) Release/obj.target/bufferutil/src/bufferutil.o 
make: g++: Command not found 
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 127 
make: Leaving directory `/root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build' 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) 
gyp ERR! stack  at ChildProcess.emit (events.js:110:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:1074:12) 
gyp ERR! System Linux 3.13.0-55-generic 
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /root/chat-example/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil 
gyp ERR! node -v v0.12.7 
gyp ERR! node-gyp -v v2.0.1 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 
npm WARN optional dep failed, continuing [email protected] 
[email protected] node_modules/socket.io 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

Проверьте эту ошибку и причину проблемы?

Пожалуйста, предложите

+0

, что ОС вы используете? и как вы установили node.js? –

+0

@Kichu попробуйте с 'sudo npm install socket.io --save' –

ответ

1

вы пробовали установки узла-Gyp и г ++?

npm install -g node-gyp 

и г ++

apt-get install g++ 
Смежные вопросы