简体   繁体   English

由于 node-gyp 重建错误,无法安装 node-xmpp 或 node-expat

[英]Cannot install node-xmpp or node-expat due to node-gyp rebuild error

I am just starting out with node.js and have hit a wall trying to install node-xmpp and node-expat.我刚开始使用 node.js 并且在尝试安装 node-xmpp 和 node-expat 时遇到了麻烦。 It seems node-gyp rebuild is the common cause.似乎 node-gyp 重建是常见的原因。

I am on Ubuntu 10.04.我在 Ubuntu 10.04 上。 After running npm install node-expat , I get the following output:运行npm install node-expat ,我得到以下输出:

npm http GET https://registry.npmjs.org/node-expat
npm http 200 https://registry.npmjs.org/node-expat
npm http GET https://registry.npmjs.org/nan
npm http 200 https://registry.npmjs.org/nan

> node-expat@2.1.4 install /root/node_modules/node-expat
> node-gyp rebuild

Traceback (most recent call last):
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 534, in script_main
    return main(sys.argv[1:])
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 527, in main
    return gyp_main(args)
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 503, in gyp_main
    options.circular_check)
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 129, in Load
    params['parallel'], params['root_targets'])
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2687, in Load
    generator_input_info)
  File "/root/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 594, in LoadTargetBuildFilesParallel
    parallel_state.pool = multiprocessing.Pool(8)
  File "/usr/lib/python2.6/multiprocessing/__init__.py", line 227, in Pool
    return Pool(processes, initializer, initargs)
  File "/usr/lib/python2.6/multiprocessing/pool.py", line 84, in __init__
    self._setup_queues()
  File "/usr/lib/python2.6/multiprocessing/pool.py", line 131, in _setup_queues
    self._inqueue = SimpleQueue()
  File "/usr/lib/python2.6/multiprocessing/queues.py", line 328, in __init__
    self._rlock = Lock()
  File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 117, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 49, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 38] Function not implemented
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/root/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 2.6.18-028stab093.2
gyp ERR! command "node" "/root/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-expat@2.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.1.4 install script.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.18-028stab093.2
npm ERR! command "node" "/root/local/bin/npm" "install" "node-expat"
npm ERR! cwd /root
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0

Many thanks for any help you can provide.非常感谢您提供的任何帮助。

Update: the relevant error message here is OSError: [Errno 38] Function not implemented and led to the solution.更新:这里的相关错误信息是OSError: [Errno 38] Function not implemented并导致解决方案。

Solution found here Django Celery Implementation - OSError errno 38 - Function not implemented .解决方案在此处找到Django Celery Implementation-OSError errno 38-Function not implementation

Steps as follows:步骤如下:

  1. Add none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 to /etc/fstab .none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0/etc/fstab
  2. Then sudo mount /dev/shm然后sudo mount /dev/shm
sudo apt-get install build-essential
sudo apt-get install libssl-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM