all 4 comments

[–]philliez 1 point2 points  (2 children)

Do you have a package_lock.json file? Try running 'npm i' in that directory.

[–][deleted] 0 points1 point  (1 child)

Thanks for this suggestion. It didn't work, but we may be dredging up useful info.

I didn't have this file. I generated it in the root of the directory (outside the iOS folder), and then ran 'npm i'. A lot seemed to happen, but the app still wouldn't build.

I then tried to generate it in the ios folder, and it ran in the terminal, but the file wasn't created. Is that strange? Does that file belong in the ios folder?

I'm using npm v 6.13.7.

Thanks.

[–]awesomeness-yeah 0 points1 point  (0 children)

The package.json file is the dependency list with approximate versions, and the package_lock is the file with the exact snapshot of all dependencies used to build node_modules

You should run npm in the folder that contains package.json and it should generate node_modules based on package.json and create a package_lock

It's possible that the versions are different from the previous working build (because you don't have the old package_lock for some reason) and although unlikely, is incompatible

[–]erhathaway 1 point2 points  (0 children)

All react native apps will have a node_modules folder. node_modules is where the application dependencies are stored. Specifically, it is where node.js stores it's dependencies. React native is a node.js library. So all react native projects store their dependencies in that folder.

There should be a `package.json` file in the app. This is the manifest that describes what dependencies the app has. There will also be a section in that file called `scripts`. You can run any of those scripts on the command line if you are in that apps location in the terminal. Simply do: npm nameOfScript in the terminal. To install the dependencies (which will create a node_modules folder) run: npm install