Skip to content

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

Closed
@grgur

Description

@grgur

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

Activity

luigy

luigy commented on Feb 11, 2015

@luigy

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

amasad

amasad commented on Feb 11, 2015

@amasad
Contributor

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

grgur

grgur commented on Feb 11, 2015

@grgur
Author

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

amasad commented on Feb 12, 2015

@amasad
Contributor

closed via 5aa5e7a

locked as resolved and limited conversation to collaborators on May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @amasad@grgur@luigy@react-native-bot

        Issue actions

          npm start -> Cannot call method 'forEach' of undefined · Issue #57 · facebook/react-native