kirill3333 / react-avatar

👤 Load, crop & preview avatar with React
http://kirill3333.github.io/react-avatar
MIT License
558 stars 101 forks source link

Fix unexpected token in JSON #90

Closed augustmuir closed 2 years ago

augustmuir commented 2 years ago

Pull #89 uses || in version which results in the error below. Changed react version syntax from ^16.x || ^17 to >=16.x to fix this issue.

npm ERR! JSON.parse Unexpected token "}" (0x7D) in JSON at position 1618 while parsing near "... \"^16.x || ^17\",\r\n  }\r\n}\r\n"
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
paintedbicycle commented 2 years ago

Switching to >=16.x is fine, but there's no need to drop React 17. In order to support the next major version too, you actually still need to add it as an ||

So: >=16.x || ^17

augustmuir commented 2 years ago

@paintedbicycle great thanks ~ that fixes the parsing error for me. Updated this pr to "react": ">=16.x || ^17" 54425d31dbe4c85407c4171449b45be338201ea4