ember-cli / ember-compatibility-helpers

Helpers that allow you to write backwards compat Ember addons
MIT License
24 stars 20 forks source link

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

Open trevordevore opened 3 years ago

trevordevore commented 3 years ago

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.