user577268
user577268

Reputation: 55

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. It seems node-gyp rebuild is the common cause.

I am on Ubuntu 10.04. After running npm install node-expat, I get the following output:

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

> [email protected] 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! [email protected] install: `node-gyp rebuild`
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-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.

Upvotes: 3

Views: 1717

Answers (2)

Chatcharin Pingkeaw
Chatcharin Pingkeaw

Reputation: 21

sudo apt-get install build-essential
sudo apt-get install libssl-dev

Upvotes: 1

user577268
user577268

Reputation: 55

Solution found here Django Celery Implementation - OSError errno 38 - Function not implemented.

Steps as follows:

  1. Add none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 to /etc/fstab.
  2. Then sudo mount /dev/shm

Upvotes: 1

Related Questions