0

I have a repo (React, Webpack4, npm, babel) which installs & runs fine on my machine (original and fresh clone) but when pulled down to another machine it throws an error on npm start (after successfully runnning npm install.

Module not found: Error: Can't resolve 'react-tabs' in XXX

The dependency in question react-tabs is installed in node_modules on both machines.

ERROR in ./src/containers/PAGE.js Module not found: Error: Can't resolve 'react-tabs' in '/home/Repos/PROJECT/src/containers' @ ./src/containers/PAGE.js 11:0-58 9095:88-92 9095:120-127 9095:155-158 9099:38-41 9103:34-37 9107:35-38 9111:39-42 9115:37-40 9115:74-77 9115:182-190 9119:27-35 9123:27-35 9127:27-35 9131:27-35 9135:27-35 9135:64-72 @ ./src/App.js @ ./src/index.js @ multi ./src/index.js Child html-webpack-plugin for "index.html": 1 asset Entrypoint undefined = ./index.html [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 574 bytes {0} [built] [./node_modules/lodash/lodash.js] 528 KiB {0} [built] [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built] [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built] ℹ 「wdm」: Failed to compile.

Rich
  • 970
  • 2
  • 16
  • 42
  • maybe a stupid question but did you do `npm install` before you ran `npm start`? If you did and it still doesn't work you can remove your node modules and install again to see if that works. You would do `rm -rf node_modules` in the root of your directory. then `npm install` then `npm start` Ignore that. This looks it's not found in that specific component. Are you using that package in another component? Or just `PAGE.js`? – Bens Steves Aug 21 '19 at 09:00
  • yes we did - never a stupid question. The package is used just in that component currently but npm start works fine on 2 other machines – Rich Aug 21 '19 at 11:11
  • did you npm start / install in the root of your project not /home? maybe it's looking for `react-tabs` in `/home`?? maybe check to see that your node_modules are in `PROJECT` and not home... – Bens Steves Aug 21 '19 at 11:34
  • hi Ben, I've been assured that both are being run in the root - they've done the same on another machine in parallel and was fine so I believe it's not a repo thing but a system issue. Can't understand what though. – Rich Aug 21 '19 at 19:51

0 Answers0