Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo app saying react-native-scripts: command not found when trying to run script to generate custom styles #1624

Closed
acomito opened this issue Jul 29, 2017 · 6 comments
Labels

Comments

@acomito
Copy link

acomito commented Jul 29, 2017

Version

1.5.0

Environment

npm 5.3.0, node v8.2.1, "antd-mobile": "^1.5.0", "expo": "^19.0.0",

Reproduction link

https://mobile.ant.design/docs/react/use-with-create-react-app#React-Native-project

Steps to reproduce

create a fresh expo project, npm i -S antd-mobile, then follow these instructions: https://mobile.ant.design/docs/react/use-with-create-react-app#React-Native-project

What is expected?

expected to output a styles file

What is actually happening?

sh: react-native-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: node scripts/custom-rn-theme && react-native-scripts start
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:


maybe related to npm version issue?

expo/create-react-native-app#233

expo/create-react-native-app#239

@acomito
Copy link
Author

acomito commented Jul 29, 2017

Okay, figured it out. Maybe to improve the docs you can:

  1. If you haven't, point to the list of variables: https://github.com/ant-design/ant-design-mobile/blob/master/components/style/themes/default.tsx#L137

  2. mention that you may see an error message when you run the npm start script, but that it most likely did it's theme work anyway

  3. mention that once you run this script, and change some variables, those variables are forever changed. You need to explicitly change them again.. in other words, if I change the border of the card to green and run "npm start", then my card borders are green. If I remove that variable from my theme file, and rerun "npm start", the script runs again but my cards will still be green (it doesnt go back to default). I would need to explicitly change the card border from green back to grey (the default) in my theme file.

@paranoidjk
Copy link
Contributor

@acomito It will be great if you are willing to PR to help us enhance the document. 😄

@acomito
Copy link
Author

acomito commented Jul 30, 2017

@paranoidjk Okay. I wasn't sure if you wanted it in mandarin or not. I can look into doing a PR.

@paranoidjk
Copy link
Contributor

@acomito Just english version is enough,we will help you with chinese translation.

@silentcloud
Copy link
Contributor

silentcloud commented Jul 31, 2017

@acomito I follow the doc and everything is ok.

npm install -g yarn
npm install -g create-react-native-app
create-react-native-app antm-demo
cd antm-demo
yarn add antd-mobile
yarn add babel-plugin-import --dev

then

follow: https://mobile.ant.design/docs/react/use-with-create-react-app#React-Native-project

  • modify .babelrc and App.js
  • create theme.js in root project path;
mkdir scripts
curl https://raw.githubusercontent.com/ant-design/antd-mobile-samples/master/rn-custom-ui/scripts/custom-rn-theme.js -o scripts/custom-rn-theme.js
npm run start
npm run ios

@acomito
Copy link
Author

acomito commented Aug 2, 2017

Hey @silentcloud, yes everything is all set. It was my mistake. I had a suggestion to add more detail to the docs, but I haven't got around to it. Please feel free to close this issue though.

Loving antd-mobile. Looking forward to 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants