Problem on npm install mediasoup

Hi I tried to install “npm install mediasoup” and got this error below. (I also tried 'npm install in server folder of mediasoup-demo and got same error)

npm install mediasoup@3
npm WARN deprecated request@2.88.2: request has been deprecated, see
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

clang-tools-prebuilt@0.1.4 postinstall /Users/elska/Sites/mediasoup-demo/server/node_modules/clang-tools-prebuilt
node install.js

unziping /Users/elska/.clang-tools/clang-tools-r298696-mac.tgz

mediasoup@3.6.16 postinstall /Users/elska/Sites/mediasoup-demo/server/node_modules/mediasoup
node npm-scripts.js postinstall

npm-scripts.js [INFO] running task “postinstall”
npm-scripts.js [INFO] executing command: make -C worker
python ./scripts/ -R mediasoup-worker
[’-R’, ‘mediasoup-worker’, ‘/Users/elska/Sites/mediasoup-demo/server/node_modules/mediasoup/worker/mediasoup-worker.gyp’, ‘-I’, ‘/Users/elska/Sites/mediasoup-demo/server/node_modules/mediasoup/worker/common.gypi’, ‘–depth=.’, ‘-f’, ‘make’, ‘-Goutput_dir=/Users/elska/Sites/mediasoup-demo/server/node_modules/mediasoup/worker/out’, ‘–generator-output’, ‘/Users/elska/Sites/mediasoup-demo/server/node_modules/mediasoup/worker/out’, ‘-Dgcc_version=42’, ‘-Dclang=1’, ‘-Dhost_arch=x64’, ‘-Dtarget_arch=x64’, ‘-Dopenssl_fips=’, ‘-Dmediasoup_asan=false’, ‘-Dnode_byteorder=little’]
xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance
Traceback (most recent call last):
File “./scripts/”, line 111, in
File “./scripts/”, line 49, in run_gyp
rc = gyp.main(args)
File “./deps/gyp/pylib/gyp/”, line 545, in main
return gyp_main(args)
File “./deps/gyp/pylib/gyp/”, line 530, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File “./deps/gyp/pylib/gyp/generator/”, line 2210, in GenerateOutput
part_of_all=qualified_target in needed_targets)
File “./deps/gyp/pylib/gyp/generator/”, line 820, in Write
File “./deps/gyp/pylib/gyp/generator/”, line 1215, in WriteSources
cflags = self.xcode_settings.GetCflags(configname)
File “./deps/gyp/pylib/gyp/”, line 630, in GetCflags
archs = self.GetActiveArchs(self.configname)
File “./deps/gyp/pylib/gyp/”, line 488, in GetActiveArchs
xcode_archs_default = GetXcodeArchsDefault()
File “./deps/gyp/pylib/gyp/”, line 120, in GetXcodeArchsDefault
xcode_version, _ = XcodeVersion()
File “./deps/gyp/pylib/gyp/”, line 1402, in XcodeVersion
version_list = GetStdout([‘xcodebuild’, ‘-version’]).splitlines()
File “./deps/gyp/pylib/gyp/”, line 1459, in GetStdout
sys.stderr.write(out + b’\n’)
TypeError: write() argument must be str, not bytes
make: *** [default] Error 1
npm ERR! errno 1
npm ERR! mediasoup@3.6.16 postinstall: node npm-scripts.js postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mediasoup@3.6.16 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Anyone who can help to figure out this error?

My mac OS version is 10.14.5
and I use Python 3.7.3 and npm 6.14.8 (the latest)


Xcode or CommandLineTools missing. Do a google search.

am getting the same error in win 10

No, it’s impossible that you get the same error in Windows.