I recently cloned a react-native project from GitHub to start working on it, but encountered an issue with npm start failing and displaying the following error:
Error: Cannot find module 'minizlib'
Require stack:
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/create.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Extract.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Api.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/xdl.js
- /usr/local/lib/node_modules/expo-cli/build/exp.js
- /usr/local/lib/node_modules/expo-cli/bin/expo.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js:28:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/yeastbeast/.npm/_logs/2019-07-07T13_59_02_331Z-debug.log
For reference, here is the debug log file:
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c021c012c5a4255425c">[email protected]</a>
3 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="432d2c2726033572716d756d73">[email protected]</a>
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/geoffrey/mhs-protect/node_modules/.bin:/home/geoffrey/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle @~start: CWD: /home/geoffrey/mhs-protect
10 silly lifecycle @~start: Args: [ '-c', 'expo start' ]
11 silly lifecycle @~start: Returned: code: 1 signal: null
12 info lifecycle @~start: Failed to exec start script
13 verbose stack Error: @ start: `expo start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:203:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:203:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd /home/geoffrey/mhs-protect
16 verbose Linux 4.18.0-25-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v12.6.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ start: `expo start`
22 error Exit status 1
23 error Failed at the @ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I have attempted to reinstall minizlib, npm, and node multiple times, as well as exploring various solutions mentioned in similar discussions, unfortunately without any success so far. Any suggestions or assistance would be greatly appreciated.
Operating System: Ubuntu 18.04.2
GitHub Repository Link: link to github repo
Edit: I'm not entirely certain what transpired, but it appears that the issue has been resolved. Upon reopening the project today, I received warnings about vulnerabilities. To address them, I reinstalled expo-cli which seems to have rectified the problems and everything is now functioning correctly.