When I run my Jenkins build for my React Native project it fails with the following errors:
Unable to resolve module `reactotron-core-client` from `/Users/nfib/Jenkins/Jenkins-Workspaces/ENGA/ENGAL/node_modules/reactotron-redux/dist/index.js`: Module does not exist in the module map
Execution failed for task ':app:bundleDevReleaseJsAndAssets'.
I followed the recommended rm -rf node_modules && npm install but I am not exactly sure that this would help, since it seems to me like it's a generic solution from the npm team.
React-Native version: 0.53.3 with "reactotron-react-native": "3.5.0", "reactotron-redux": "3.1.0",
How can I ensure this does not continue to happen?
The issue is your
Jenkinsbuild server is unable to locate thereactotron-core-clientmodule which is necessary to complete yourJenkinsbuild. You can see this from your stack trace:The recommended solution from the
npmteam of:is a generic solution because this command will remove your previous
node_modulesdirectory containing your project's dependencies and then reinstall the listed dependencies within in your project'spackage.jsonfile. This may resolve issues stemming from your lock file as well as versioning issues ifnpmhas been updated on your build server.This solution may resolve your issue if all of your project's required libraries are listed within your
package.jsonfile. However, if thereactotron-core-clientlibrary isn't listed as a required dependency within yourpackage.jsonfile this problem will persist moving forward. Perhaps you could try the following:npm i --save reactotron-core-clientas this will save and install the
reactotron-core-clientdependency for your project. By save I mean list this library as dependency within yourpackage.jsonfile.Ideally, moving forward your best bet is to keep your
package.jsonfile up-to-date with your project's dependencies as well as installing dependencies prior to attempting aJenkinsbuild.Hopefully that helps!