question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error starting packager: TypeError: Cannot read property 'version' of undefined

See original GitHub issue

Description

When I try to use yarn start , I got this error. Error starting packager: TypeError: Cannot read property 'version' of undefined

Expected Behavior

All commands I used: create-react-native-app rn-awe yarn start

Observed Behavior

Error details

E:\Web\Joe.Wu\rn-awe>yarn start
yarn run v1.3.2
$ react-native-scripts start
17:16:47: Starting packager...
17:17:43: Error starting packager: TypeError: Cannot read property 'version' of undef
    at E:\xdl\src\project\Doctor.js:641:44
    at E:\Web\Joe.Wu\rn-awe\node_modules\lodash\lodash.js:4944:15
    at baseForOwn (E:\Web\Joe.Wu\rn-awe\node_modules\lodash\lodash.js:3001:24)
    at E:\Web\Joe.Wu\rn-awe\node_modules\lodash\lodash.js:4913:18
    at Function.forEach (E:\Web\Joe.Wu\rn-awe\node_modules\lodash\lodash.js:9359:14)
    at E:\xdl\src\project\Doctor.js:631:9
    at Generator.next (<anonymous>)
    at step (E:\Web\Joe.Wu\rn-awe\node_modules\react-native-scripts\node_modules\xdl\
    at E:\Web\Joe.Wu\rn-awe\node_modules\react-native-scripts\node_modules\xdl\build\
    at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

  • npm ls react-native-scripts: – react-native-scripts@1.6.0
  • npm ls react-native: – (empty) (Actually react-native is installed inside node_modules. I don’t know why there is empty.)
  • npm ls expo: – (empty)
  • node -v: v8.7.0
  • npm -v: 5.4.2
  • yarn --version: 1.3.2
  • watchman version: Not installed

Also specify:

  1. Operating system: Windows 7
  2. Phone/emulator/simulator & version: Nubia NX549J

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
TomKarachristoscommented, Dec 10, 2017

I solve this problem:

  1. delete node-modules folder
  2. delete package-lock and yarn-lock and left only the the package.json
  3. run yarn install.
0reactions
travellerwjoecommented, Jan 29, 2018

@fson Thank you for your support. I have tried again. It works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'version' of undefined #2866 - GitHub
If it's yarn serve or npm run serve , then it's because eslint is not added to your project (I don't see it...
Read more >
Cannot read property 'version' of undefined Vue.js - Stack ...
First, I'd search stack trace of the error to locate which file is requesting package.json . Global project search for .version should help ......
Read more >
TypeError: Cannot read property 'version' of undefined
Just do npm install eslint inside the project. It should work. [ad_2]. Content Protection by DMCA.com. Please Share.
Read more >
ERROR TypeError: Cannot read property 'version' of undefined Vue ...
When I run npm start. I get. ERROR TypeError: Cannot read property 'version' of undefined TypeError: Cannot read property 'version' of undefined.
Read more >
npm install cannot read properties of null (reading 'children')
The error message means that npm is trying to read the version property of the folder's package.json file but doesn't find the file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found