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
Jenkins
build server is unable to locate thereactotron-core-client
module which is necessary to complete yourJenkins
build. You can see this from your stack trace:The recommended solution from the
npm
team of:is a generic solution because this command will remove your previous
node_modules
directory containing your project's dependencies and then reinstall the listed dependencies within in your project'spackage.json
file. This may resolve issues stemming from your lock file as well as versioning issues ifnpm
has 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.json
file. However, if thereactotron-core-client
library isn't listed as a required dependency within yourpackage.json
file this problem will persist moving forward. Perhaps you could try the following:npm i --save reactotron-core-client
as this will save and install the
reactotron-core-client
dependency for your project. By save I mean list this library as dependency within yourpackage.json
file.Ideally, moving forward your best bet is to keep your
package.json
file up-to-date with your project's dependencies as well as installing dependencies prior to attempting aJenkins
build.Hopefully that helps!