rrdelaney / reason-scripts

:beginner: Create a ReasonML and React development environment
MIT License
628 stars 58 forks source link

Doesn't create Reason App anymore #34

Closed Gregoirevda closed 6 years ago

Gregoirevda commented 6 years ago

I used this utility several times, but now it only generates a ReactJS app... I only have .js files with yarn create react-app my-app --scripts-version reason-scripts

node: v8.9.1 yarn: 1.1.0

Gregoirevda commented 6 years ago

Managed to make it work with npm

rrdelaney commented 6 years ago

Sorry, didn’t mean to close this.

By managed to make it work with npm, did you mean that you installed CRA with npm globally, and then ran the global script?

Gregoirevda commented 6 years ago

create-react-app <app-name> --scripts-version reason-scripts worked, but not yarn create react-app my-app --scripts-version reason-scripts having bs-platform installed globally with npm

rrdelaney commented 6 years ago

Can you paste a log and explain what you mean by "not work"? Did the installation fail, nothing get created, etc.

I just tryed using yarn create on MacOS High Sierra with Yarn 1.3.2 and Node 9.2 and everything seemed to work fine.

Gregoirevda commented 6 years ago

Sure: node -v => v8.9.1 yarn create react-app my-app --scripts-version reason-scripts => All OK ls my-app/src => App.css App.js App.test.js index.css index.js logo.svg registerServiceWorker.js No Reason files in here

rrdelaney commented 6 years ago

That’s weird. Can you paste the file contents of the generated package.json? As well as the log output when creating a new app.

Gregoirevda commented 6 years ago

package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-scripts": "1.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

Output

yarn create react-app my-app --scripts-version reason-scripts
yarn create v1.1.0
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ“ƒ  Building fresh packages...
success Installed "create-react-app@1.5.1" with binaries:
      - create-react-app
[#######################################################################################################################################################################################################################] 296/296
Creating a new React app in /Users/greg/dev/trash/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.1.0
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ“ƒ  Building fresh packages...
success Saved lockfile.
success Saved 915 new dependencies.

✨  Done in 27.06s.

Success! Created my-app at /Users/greg/dev/trash/my-app
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd my-app
  yarn start

Happy hacking!
✨  Done in 33.87s.
rrdelaney commented 6 years ago

Looks like this is a problem with your Yarn version. It was fixed in Yarn 1.3.0.

Yarn changelog: https://github.com/yarnpkg/yarn/releases/tag/v1.3.0 Yarn PR: https://github.com/yarnpkg/yarn/pull/4713

Gregoirevda commented 6 years ago

Thanks

rrdelaney commented 6 years ago

If you need to keep using Yarn 1.1 you can run yarn create react-app -- --scripts-version reason-scripts.