ember-cli/ember-compatibility-helpers

`fs.readJsonSync is not a function` error if `ember-source` is not in `package.json`

trevordevore opened this issue · 0 comments

I updated an Ember app written in 2.x today. After using ember-cli-update --to 3.4 I encountered the following error when running ember build:

fs.readJsonSync is not a function

The problem appears to be in index.js on line 37:

 bowerDirectory = fs.readJsonSync(bowerrcPath).directory;

The error went away after I added ember-source to the project's package.json file since this results in this.emberVersion being set and fs.readJsonSync not being called. I'm creating this issue as I couldn't find any information on that particular error and it took me a while to track down.