From 3415e31f467fc35273dfaec09768290f34ee0a54 Mon Sep 17 00:00:00 2001 From: Steve Kellock Date: Thu, 18 Feb 2016 07:35:18 -0800 Subject: [PATCH] Adds additional help when a module is missing. Summary:Hey. Long time fan, first time forker. You know when you're working on a project with someone and they bring in a new dependency? When you first pull their code and you haven't also installed that dependency, the error that is shown is this: ![image](https://cloud.githubusercontent.com/assets/68273/13145164/d8748b3e-d61c-11e5-9df9-3e47edf3fcfb.png) This PR simply adds `or running "npm install"` to the end of that message. Just adds a little clarity to newcomers. Hell knows I was lost for a while when I was starting. ![image](https://cloud.githubusercontent.com/assets/68273/13145253/65e8f31a-d61d-11e5-99ac-2d79d8e37123.png) Closes https://github.com/facebook/react-native/pull/6009 Differential Revision: D2949127 Pulled By: davidaurelio fb-gh-sync-id: b297d8c1570fec23cb179ddab4847e2438cc463b shipit-source-id: b297d8c1570fec23cb179ddab4847e2438cc463b --- .../react-packager/src/Resolver/polyfills/require-unbundle.js | 2 +- packager/react-packager/src/Resolver/polyfills/require.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packager/react-packager/src/Resolver/polyfills/require-unbundle.js b/packager/react-packager/src/Resolver/polyfills/require-unbundle.js index 87e856013..9c1e36e77 100644 --- a/packager/react-packager/src/Resolver/polyfills/require-unbundle.js +++ b/packager/react-packager/src/Resolver/polyfills/require-unbundle.js @@ -80,7 +80,7 @@ function unknownModuleError(id) { let message = 'Requiring unknown module "' + id + '".'; if (__DEV__) { message += - 'If you are sure the module is there, try restarting the packager.'; + 'If you are sure the module is there, try restarting the packager or running "npm install".'; } return Error(message); } diff --git a/packager/react-packager/src/Resolver/polyfills/require.js b/packager/react-packager/src/Resolver/polyfills/require.js index bc2824bba..764e4dd1e 100644 --- a/packager/react-packager/src/Resolver/polyfills/require.js +++ b/packager/react-packager/src/Resolver/polyfills/require.js @@ -48,7 +48,7 @@ function requireImpl(id) { if (!mod) { var msg = 'Requiring unknown module "' + id + '"'; if (__DEV__) { - msg += '. If you are sure the module is there, try restarting the packager.'; + msg += '. If you are sure the module is there, try restarting the packager or running "npm install".'; } throw new Error(msg); }