I created a React Native project by expo. Today I found there was a legacy compiling issue, so I deleted node_modules folder and tried to rebuild it. But when I ran: npm run build, it said: Missing script: "build". I also tried npm build or expo build, neither worked.
My package.json as following:
{
"name": "techpop",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#expo/vector-icons": "^13.0.0",
......
}
}
Mustafa answered my question in comments, the command npm install works!
If you want to create a build for android
expo build:android
If you want to create a build for ios
expo build:ios
Related
i´m running my react native app with bare workflow, and when i try to execute it with yarn android i get this error:
Could not read script 'C:\Users\claud\OneDrive\├?rea de Trabalho\teste\node_modules\expo\scripts\autolinking.gradle' as it does not exist.
package.json
{
"name": "teste",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~47.0.9",
"expo-splash-screen": "~0.17.5",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
"react-native": "0.70.5"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
"private": true
}
In my case it was because of yarn's new policy, "PnP"!
There's a perfect workaround here
I am trying to debug a React Native code running on Expo web locally using vscode.
I tried these configurations in launch.json:
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Attach to packager",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "attach",
"port": "19001",
}
and in both cases Expo runs and the debugger attaches:
Debugger listening on ws://127.0.0.1:64192/13e8c77d-9c88-4909-9762-9b5bf8b70f90
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached
But the breakpoints are either unbounded or not working.
This is the scripts in package.json:
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
Any idea on what I'm missing?
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^34.0.3",
"firebase": "^6.3.4",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-elements": "^1.1.0",
"react-native-router-flux": "^4.0.6",
"react-native-web": "^0.11.4"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0"
},
"private": true
}
App.json
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
how to resolve this as --reset-cache have no effect and Also the error is shown for that file which is not even the part of the project.
I also find same type of issue on stackoverflow here
but that is for react-native-cli in which upgrading react-native-cli resolved the issue.
I tried to upgrade expo-cli but nothing happen things remain the same.
I hope I am able to explain the issue
You can try expo start -c
It should be executed with the correct method of execution.
I'm developing a react-native app with expo cli but when i execute expo start appear this error:
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
already i reinstall expo cli
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"expo": "^31.0.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0",
"expo-cli": "^2.7.0"
},
"private": true
}
i want to emulate this app in genymotion
I type command create-react-native-app <My package name>
then i type npm start i can see QRCode shows on my terminal
But when i type npm run eject for my project
I type npm start again. There's no QRCode show on my terminal any more.
I looking for some answer still can't fix it. It confused with me a lot.
Here is my environment:
Mac OS:10.13.4
{
"name": "TestMovie2",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"eslint-config-rallycoding": "^3.2.0",
"jest": "^22.4.3",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.0-alpha.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"#shoutem/animation": "^0.12.2",
"#shoutem/ui": "^0.23.4",
"react": "16.3.0-alpha.1",
"react-native": "0.54.0"
}
}
Hope you have solved the problem , but anyone still facing the problem can just type expo start instead of npm start