mirror of
https://github.com/status-im/metro.git
synced 2025-03-02 11:40:55 +00:00
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:  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.  Closes https://github.com/facebook/react-native/pull/6009 Differential Revision: D2949127 Pulled By: davidaurelio fb-gh-sync-id: b297d8c1570fec23cb179ddab4847e2438cc463b shipit-source-id: b297d8c1570fec23cb179ddab4847e2438cc463b
This commit is contained in:
parent
278b40ff69
commit
c107132a36
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user