Closed Gregoirevda closed 6 years ago
Managed to make it work with npm
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?
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
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.
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
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.
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.
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
Thanks
If you need to keep using Yarn 1.1 you can run yarn create react-app -- --scripts-version reason-scripts
.
I used this utility several times, but now it only generates a ReactJS app... I only have
.js
files withyarn create react-app my-app --scripts-version reason-scripts
node: v8.9.1 yarn: 1.1.0