Encountered an error when attempting to run npm start due to the absence of the required module 'minizlib

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.

Answer №1

The package.json files contain the following:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "dependencies": {
    "braces": "^2.3.1",
    "expo": "^32.0.0",
    "firebase": "^6.1.0",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
    "react-navigation": "^3.11.0",
    "ws": "^3.3.3"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0"
  },
  "private": true
}

The package.json file does not have an entry for the minizlib package, and the node_modules folder does not contain a minizlib folder.

You may have forgotten to install the minizlib package. You can do so by running the following command:

npm install minizlib --save // using `--save` will add an entry to the `package.json` file

Once you have installed the package, remember to restart your app.

Answer №2

Run npm install -g npm@latest to update the npm package.

Delete node_modules using rm -rf to remove the current modules.

Execute npm install to reinstall all project dependencies.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to transform the data received from this function into a DataTable that can be used with the Google Charts API?

Is there a way to easily convert the data returned by this function into a format that Google Charts API can read? public function ajax_get_dates(){ $data = ([['date1' => '04/08/2016'], ['date2' => '05/08/2016& ...

Implement a click event to trigger a search functionality within Bootstrap

I have implemented the following code to add search options in the navigation bar. It is displaying correctly, but I am not getting the click action that I require. For example, I want to trigger an action from JavaScript when the user clicks on the enter ...

Having trouble with installing redux using npm?

When I try to run npm install redux, an error occurs: npm ERR! fetch failed https://registry.npmjs.org/lodash-es/-/lodash-es-4.6.0.tgz npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404 It seems there might be a pr ...

SapUI5: Implementing a toggle functionality to display/hide one list item based on another list item's action

UI5 is a versatile framework with numerous possibilities, but sometimes I find myself struggling to implement ideas that would be easier in traditional HTML. Here's the scenario: I want to create a List with ListItems that display cities like Berlin, ...

What methods are available to trigger an AutoHotkey script using JavaScript?

I'm in the process of creating a Chrome extension designed to streamline tasks. I've come to a stage where I require my extension to execute certain AutoHotkey scripts. Is there a method to execute an AutoHotkey script using JavaScript? (I' ...

Need help with resetting a value in an array when a button is clicked?

Using Tabulator to create a table, where clicking on a cell pushes the cell values to an array with initial value of '0'. The goal is to add a reset button that sets the values back to '0' when clicked. component.ts names = [{name: f ...

Employ a class function within router.get

I'm a beginner with node.js and I'm running into an issue when trying to use a class method in the router.get callback function. Can someone assist me with this problem? Route.get() is expecting a callback function but received a [object object] ...

Personalized categorization of d3 information

My json data consists of timestamps like: [{"Time":"2017-02-07 16:14:06"}, {"Time":"2017-02-07 16:58:49"}, {"Time":"2017-02-07 17:07:11"}, {"Time":"2017-02-07 18:13:19"}, {"Time":"2017-02-07 13:56:06"}, {"Time":"2017-02-07 19:07:57"}, {"Time":"2017-02-07 ...

Content does not become interactive upon the initial loading of the page

I've modified a W3 schools slideshow template to use text instead of dots, but I'm encountering two issues 1: The first image doesn't load when the page loads. Although using a class ID and setting it to active fixes this issue, it leads to ...

What is the best way to remove a class from an element upon successful completion?

How can I make an image disappear when the user clicks a button in the associated form? I'm struggling to implement this feature. Any suggestions? <script type="text/javascript"> $(document).ready(function() { $(".removebutton").s ...

Tips for preventing my component from being duplicated during the development process

I found a helpful guide on creating a JavaScript calendar in React that I am currently following. After implementing the code, I successfully have a functional calendar UI as shown below: // https://medium.com/@nitinpatel_20236/challenge-of-building-a-cal ...

Issue with the dynamic updating of props

Every time a radio button is clicked within Test.js, the handleclick function executes, updating an array. However, the issue lies in not sending this updated array back to graph_test.js. As a result, graph_test.js only receives the initial array filled wi ...

Having trouble launching Appium through Jenkins programmatically, however it works fine when executed from Eclipse

For some reason, I am having trouble starting appium through Jenkins programmatically. Oddly enough, it works perfectly fine when launched from Eclipse. When attempting to start appium through Jenkins, the console presents an error message without any det ...

Is there a way to incorporate multiple rules from data into a text component using Vuetify?

I'm looking to establish specific rules within a mixin for my components. Allow me to provide a straightforward example of my request: Example Link The code snippet: <v-text-field :rules="[nbRules, requiredRules]" outlined v-model="name" label ...

Error: The `ngMetadataName` property cannot be accessed because it is undefined or null in Internet Explorer version 10

Encountered an issue in IE 10 that is not present in IE 11: Error: TypeError: Unable to get property 'ngMetadataName' of undefined or null reference The property ngMetadataName can be found in the file vendor.js. This is the content of polyf ...

Issue with Kendo dropdown's optionLabel functionality malfunctioning

Check out the Kendo code snippet below for a dropdown control. I'm currently facing an issue where I am trying to display a "Please select" option in the dropdown. This code works perfectly fine for all other dropdowns except for this specific one. T ...

Chart rendering failure: unable to obtain context from the provided item

I am encountering an issue while trying to incorporate a chart from the charts.js library into my Vue.js and Vuetify application. The error message that keeps popping up is: Failed to create chart: can't acquire context from the given item Even af ...

Discover the #ID and apply AddClass through the URL in the Navigation Jquery

I am currently in the process of developing a website and I am looking to navigate from one link to another using IDs. Here is an example of what I am trying to achieve: Page Name: index.html <a href= "collection.html#rings">Rings</a> Page N ...

(node:3588) UnhandledPromiseRejectionWarning: Encountered an issue with the syntax: Unexpected token '??=' when running the command "npm run dev" for React with Vite framework

After creating a React project using Vite, I encountered an issue specifically when running it in VS Code. When I attempt to run the project from the command prompt with npm run dev, I receive the following error message: (node:3588) UnhandledPromiseReje ...

Guide to adding an image with feathers.js and multer:

I am currently working on integrating feathers.js with React for my project and I am facing an issue with uploading images. I have tried using multer and busboy for handling the upload, but I am unable to successfully upload the image or access it through ...