AnsweredAssumed Answered

Error: Cannot find module 'librsvg'

Question asked by Aniruddh Vaghasia on Sep 7, 2019
Latest reply on Sep 18, 2019 by Eugene Bychkov

Hello All,

I am facing an iOS SDK build issue on Mac OS.

when I do the
$ ./sdk build --scheme debug --platform ios --init-native
and here is the error found

Error: Cannot find module 'librsvg'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/util/svg-to-pdf.js:17:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/tasks/launch-logo-ios.js:18:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Gulp.gulp.task (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:918:5)
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:134:8)
at runNextSet (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:123:15)
at runSequence (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:135:2)
at tryCatcher (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/util.js:16:23)
at ret (eval at makeNodePromisifiedEval (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:14:23)
at Gulp.gulp.task (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:852:9)
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:134:8)
at runNextSet (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:123:15)
at Gulp.onTaskEnd (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:101:4)
at Gulp.emit (events.js:187:15)
at Gulp.Orchestrator._emitTaskDone (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:264:8)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:275:23
at finish (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:21:8)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:43:4
at tryCatcher (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:454:14)
at Promise._settlePromiseFromHandler (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:432:57)
at ReductionPromiseArray._resolve (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/reduce.js:61:19)
at Promise.completed [as _fulfillmentHandler0] (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/reduce.js:122:15)
at Promise._settlePromise (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:566:21)
at Promise._settlePromise0 (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/util/svg-to-pdf.js:17:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/tasks/launch-logo-ios.js:18:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Gulp.gulp.task (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:918:5)
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:134:8)
at runNextSet (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:123:15)
at runSequence (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:135:2)
at Gulp.gulp.task (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:852:9)
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:134:8)
at runNextSet (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:123:15)
at Gulp.onTaskEnd (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:101:4)
at Gulp.emit (events.js:187:15)
at Gulp.Orchestrator._emitTaskDone (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:264:8)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:275:23
at finish (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:21:8)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:43:4
From previous event:
at promise.then (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:733:46)
From previous event:
at Gulp.gulp.task (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:733:35)
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:279:18
at finish (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:21:8)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:43:4
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:42:5)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:134:8)
at runNextSet (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:123:15)
at runSequence (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/run-sequence/index.js:135:2)
at Gulp.gulp.task (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-tasks.js:795:5)
at module.exports (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/orchestrator/index.js:134:8)
at /Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/node_modules/gulp/bin/gulp.js:129:20
at process._tickCallback (internal/process/next_tick.js:61:11)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
[rebrand prepare iOS] Writing:
/Users/***/Documents/workspace/ReenaA/native/platforms/ios/Nomad/build-config/build-extras.xcconfig
APPLICATION_BUNDLE_ID=com.***.crm;
PRODUCT_NAME=***CRM;
BASE_GCC_PREPROCESSOR_DEFINITIONS=NATIVE_AJAX=0;
DEVELOPMENT_TEAM=;
CODE_SIGN_IDENTITY=iPhone Developer;
CODE_SIGN_IDENTITY[sdk=iphoneos*]=iPhone Developer;
PROVISIONING_PROFILE=;
/Users/***/Documents/mobile-sdk/9.0.508-1.4.2-2/tools/gulp-error-handling.js:59
throw error;
FAIL

Anyone knows how can I fix this issue?

Outcomes