CNode

求助一个小白问题:npm 安装websocket模块出错。。

Yyesoo发布于14 年前最后回复14 年前14 回复12159 浏览0 收藏

Mozilla搞了一个nodejs的游戏 我想在本地试试,可是安装模块老出错,郁闷啊 求指导

这个是 那个游戏源码: https://github.com/mozilla/BrowserQuest

下面是log

ERR! websocket@1.0.4 preinstall: make validator

ERR! cmd "/c" "make validator" failed with 1

ERR!

ERR! Failed at the websocket@1.0.4 preinstall script.

ERR! This is most likely a problem with the websocket package,

ERR! not with npm itself.

ERR! Tell the author that this fails on your system:

ERR! make validator

ERR! You can get their info via:

ERR! npm owner ls websocket

ERR! There is likely additional logging output above.

ERR!

ERR! System Windows_NT 6.1.7601

ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs \node_modules\npm\bin\npm-cli.js" "install" "websocket"

ERR! cwd D:\Work Files\Node\BrowserQuest\server

ERR! node -v v0.7.7

ERR! npm -v 1.1.15

ERR! code ELIFECYCLE

ERR! message websocket@1.0.4 preinstall: make validator

ERR! message cmd "/c" "make validator" failed with 1

ERR! errno {}

verbose exit [ 1, true ]

查看回复

回复 (14)

Y
yesoo#1·14 年前

补张截图 enter image description here

F
fish#2·14 年前

windows下 没有 make 命令, 这个模块安装的时候,有个 preinstall.sh 脚本,这个脚本需要make命令执行一些东西。

用 git-bash 试试,那里带了一个make的

Y
yesoo#3·14 年前

哈 感谢fish的回复,不过make是有了 ‘node-waf’那又报错了,郁闷, 我打算在cygwin下再试试

Z
zero7u#4·14 年前

有个简单的做法,把别人项目里面的socket.io拷过来就行了。mac也没有make命令。。

L
liu78778#6·14 年前

我也是碰到了这个问题,求解决啊

L
liu78778#7·14 年前

我找到了一种解决方案,指定websocket的版本为1.0.3,有人说这个版本就够用了 npm install websocket@1.0.3

Y
yesoo#8·14 年前

按照 liu78778 说的指定版本确实安装成功了,,但是还有最后一个问题 enter image description here

Y
yesoo#10·14 年前
引用 yesoo按照 liu78778 说的指定版本确实安装成功了,,但是还有最后一个问题 ![enter image description here][1] [1]: http://cnodejs.org...

@liu78778 这有篇相关文章,不知道你看过没,里面有引一篇老外的解决方法,我还没搞明白咋整= _=

A
atian25#14·14 年前

node-waf什么的太郁闷了,在win下是不支持的. 之前安装future出错, 在npm github问了, 人家回答, win下不支持node-waf 要作者换个编译方式

node-waf will never work on Windows. Please bug the forever authors to port to node-gyp instead.

https://github.com/isaacs/npm/issues/1651#issuecomment-4577809

参与回复
登录后即可参与回复。登录