西格温 + Node.js + socket.io 不行

发布于 2024-11-03 08:25:27 字数 2706 浏览 1 评论 0原文

我试图让node.js 全部启动并在Windows Server 2003 x64 w/ cygwin 上运行,但一直碰壁。

它希望我以 sudo 身份运行 npm,但这不是 cygwin 的选项(找不到命令..)?

$ npm install socket.io --loglevel verbose
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   'socket.io',
npm verb cli   '--loglevel',
npm verb cli   'verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb config file /home/rfitzger/.npmrc
npm verb config file /usr/local/etc/npmrc
npm verb caching /cygdrive/d/workspace/gits/hummingbird/package.json
npm verb loadDefaults [email protected]
npm verb from cache /cygdrive/d/workspace/gits/hummingbird/package.json
npm verb into /cygdrive/d/workspace/gits/hummingbird [ 'socket.io' ]
npm verb cache add [ '[email protected]', null ]
npm info addNamed [ 'socket.io', '0.6.16' ]
npm verb addNamed [ '0.6.16', '0.6.16' ]
npm verb GET socket.io/0.6.16
npm verb raw, before any munging socket.io/0.6.16
npm verb url resolving [ 'http://registry.npmjs.org/',
npm verb url resolving   './socket.io/0.6.16' ]
npm verb url resolved http://registry.npmjs.org/socket.io/0.6.16
npm verb url parsed { href: 'http://registry.npmjs.org/socket.io/0.6.16',
npm verb url parsed   protocol: 'http:',
npm verb url parsed   slashes: true,
npm verb url parsed   host: 'registry.npmjs.org',
npm verb url parsed   hostname: 'registry.npmjs.org',
npm verb url parsed   pathname: '/socket.io/0.6.16' }
npm ERR! Error: EPERM, Operation not permitted
npm ERR!     at Socket._onConnect (net.js:600:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:186:12)
npm ERR!
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR!
npm ERR!     sudo npm "install" "socket.io" "--loglevel" "verbose"
npm ERR!
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR!
npm ERR!     npm config set unsafe-perm true
npm ERR!
npm ERR! System CYGWIN_NT-5.2-WOW64 1.7.9(0.237/5/3)
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io" "--loglevel"
"verbose"
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /cygdrive/d/workspace/gits/hummingbird/npm-debug.log
npm not ok

I'm trying to get node.js all up and running on windows server 2003 x64 w/ cygwin but keep hitting walls.

It wants me to run npm as sudo but that's not an option with cygwin (command not found..)??

$ npm install socket.io --loglevel verbose
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   'socket.io',
npm verb cli   '--loglevel',
npm verb cli   'verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb config file /home/rfitzger/.npmrc
npm verb config file /usr/local/etc/npmrc
npm verb caching /cygdrive/d/workspace/gits/hummingbird/package.json
npm verb loadDefaults [email protected]
npm verb from cache /cygdrive/d/workspace/gits/hummingbird/package.json
npm verb into /cygdrive/d/workspace/gits/hummingbird [ 'socket.io' ]
npm verb cache add [ '[email protected]', null ]
npm info addNamed [ 'socket.io', '0.6.16' ]
npm verb addNamed [ '0.6.16', '0.6.16' ]
npm verb GET socket.io/0.6.16
npm verb raw, before any munging socket.io/0.6.16
npm verb url resolving [ 'http://registry.npmjs.org/',
npm verb url resolving   './socket.io/0.6.16' ]
npm verb url resolved http://registry.npmjs.org/socket.io/0.6.16
npm verb url parsed { href: 'http://registry.npmjs.org/socket.io/0.6.16',
npm verb url parsed   protocol: 'http:',
npm verb url parsed   slashes: true,
npm verb url parsed   host: 'registry.npmjs.org',
npm verb url parsed   hostname: 'registry.npmjs.org',
npm verb url parsed   pathname: '/socket.io/0.6.16' }
npm ERR! Error: EPERM, Operation not permitted
npm ERR!     at Socket._onConnect (net.js:600:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:186:12)
npm ERR!
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR!
npm ERR!     sudo npm "install" "socket.io" "--loglevel" "verbose"
npm ERR!
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR!
npm ERR!     npm config set unsafe-perm true
npm ERR!
npm ERR! System CYGWIN_NT-5.2-WOW64 1.7.9(0.237/5/3)
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io" "--loglevel"
"verbose"
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /cygdrive/d/workspace/gits/hummingbird/npm-debug.log
npm not ok

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2024-11-10 08:25:27

也许你的node.js安装是以root身份完成的?尝试在 Cygwin 下本地安装 node.js,然后在本地安装 npm,然后安装软件包

http://increaseyourgeek.wordpress.com/2010/08/18/install-node-js-without-using-sudo/

这是我使用的通用脚本:

#!/bin/bash -x

git clone git://github.com/joyent/node.git /tmp/node
export JOBS=2 # optional, sets number of parallel commands.
mkdir ~/local 
cd /tmp/node
./configure --prefix=$HOME/local/node
make
make install
export PATH=$HOME/local/node/bin:$PATH


# install NPM - Node Package Manager
curl http://npmjs.org/install.sh | sh

# install necessary node packages
npm install express  (etc..)

编辑:我在 npm 版本 0.3.17 上执行此操作..无法告诉您 npm 版本 1 上发生了什么

Perhaps your node.js installation was done as root? Try installing node.js locally under Cygwin, then install npm locally, then install the packages

http://increaseyourgeek.wordpress.com/2010/08/18/install-node-js-without-using-sudo/

Here's the general script I use:

#!/bin/bash -x

git clone git://github.com/joyent/node.git /tmp/node
export JOBS=2 # optional, sets number of parallel commands.
mkdir ~/local 
cd /tmp/node
./configure --prefix=$HOME/local/node
make
make install
export PATH=$HOME/local/node/bin:$PATH


# install NPM - Node Package Manager
curl http://npmjs.org/install.sh | sh

# install necessary node packages
npm install express  (etc..)

EDIT: I did this on npm version 0.3.17.. can't tell you what happens on npm version 1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文