ember-cli / ember-cli/ember-compatibility-helpers

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

Open
#50 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
25
Forks
19
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.