Skip to content

npm start -> Cannot call method 'forEach' of undefined #57

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
grgur opened this issue Feb 11, 2015 · 4 comments
Closed

npm start -> Cannot call method 'forEach' of undefined #57

grgur opened this issue Feb 11, 2015 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@grgur
Copy link

grgur commented Feb 11, 2015

OS: OS X 10.10.2
npm v2.5.0
node v0.10.36
commit hash: 3e59937 (after 2015-02-09 updates)
npm global and project modules updated to the latest


Error description

When starting packager I get the following error.

$ npm start

> react-native@0.0.1 start /Users/grgur/Projects/sdk/react-native
> ./packager/packager.sh


 ===============================================================
 |  Running packager on port 8081.       
 |  Keep this packager running while developing on any JS         
 |  projects. Feel free to close this tab and run your own      
 |  packager instance if you prefer.                              
 |                                                              
 |     https://github.com/facebook/react-native                 
 |                                                              
 ===============================================================

[TypeError: Cannot call method 'forEach' of undefined]
TypeError: Cannot call method 'forEach' of undefined
    at new Packager (/Users/grgur/Projects/sdk/react-native/packager/react-packager/src/Packager/index.js:49:30)
    at new Server (/Users/grgur/Projects/sdk/react-native/packager/react-packager/src/Server/index.js:13:20)
    at Object.exports.middleware (/Users/grgur/Projects/sdk/react-native/packager/react-packager/index.js:7:16)
    at getAppMiddleware (/Users/grgur/Projects/sdk/react-native/packager/packager.js:82:24)
    at runServer (/Users/grgur/Projects/sdk/react-native/packager/packager.js:101:10)
    at Object.<anonymous> (/Users/grgur/Projects/sdk/react-native/packager/packager.js:54:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

  >>> ERROR: could not create packager - please shut down any existing instances that are already running.

The error points to

function Packager(projectConfig) {
  projectConfig.projectRoots.forEach(verifyRootExists);

Rolling back to d29d07e results in a successful start

@luigy
Copy link

luigy commented Feb 11, 2015

This should do it if you're eager to try the latest as I am :)

@amasad
Copy link
Contributor

amasad commented Feb 11, 2015

oops, sorry something went wrong with the update. Looking now.

@grgur
Copy link
Author

grgur commented Feb 11, 2015

Luigy's fix works. Thanks dude

$ npm start

> react-native@0.0.1 start /Users/grgur/Projects/sdk/react-native-grgur
> ./packager/packager.sh


 ===============================================================
 |  Running packager on port 8081.       
 |  Keep this packager running while developing on any JS         
 |  projects. Feel free to close this tab and run your own      
 |  packager instance if you prefer.                              
 |                                                              
 |     https://github.com/facebook/react-native                 
 |                                                              
 ===============================================================


React packager ready.

@amasad
Copy link
Contributor

amasad commented Feb 12, 2015

closed via 5aa5e7a

@amasad amasad closed this as completed Feb 12, 2015
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants