Not able to eject again after eject react native - react-native

I am new to reactnative, I have successfully eject to a native build, and I found some thing to tweak after reactnative so I want to edit the js again and eject again.
But I found it not able to eject using npm run eject again and it shows the following error:
npm run eject
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "eject"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! missing script: eject
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/xxx/work/reactnative/maoquote/npm-debug.log
And I checked the package.json in the project folder, and the eject block was missing, but I am sure that the eject block was there before I first ejection the project, seems the framework has removed it after ejection?
Don't know why reactnative not allow me to eject again, is there any way I could do that?
I am using reactnative version 0.45
thanks !

You created the project using create-react-native-app ? Unfortunately, ejecting is not reversible, you should use your version control to manual roll back.
See Ejecting:
"Ejecting" is the process of setting up your own custom builds for
your CRNA app. It can be necessary to do if you have needs that aren't
covered by CRNA, but please note that aside from the use of version
control systems (git, hg, etc.) it is not reversible.

Related

I can't create react app by using npx create-react-app it takes long time and shows this type of error

Creating a new React app in G:\My Drive\projects\portfolio\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ENOTDIR
npm ERR! syscall mkdir
npm ERR! path G:\My Drive\projects\portfolio\my-
app\node_modules\webpack\node_modules
npm ERR! errno -4052
npm ERR! ENOTDIR: not a directory, mkdir 'G:\My
Drive\projects\portfolio\my-app\node_modules\webpack\node_modules'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2023-01-
20T08_59_44_240Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-
dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from G:\My Drive\projects\portfolio
Done.
I'm a front-end Developer. I uninstall the nodejs couple of times and then try these commands: "npm cache clean --force", npm uninstall -g create-react-app then reinstall create-react-app but it doesn't work, also updated the latest version of nodejs, use yarn also but couldn't solve the problem, delete the node_modules but it couldn't work, if anyone here pls help me!

Unable to update or execute the 'expo' command in command prompt

For the first time i tried to install the expo-cli on my project directory it worked. I can use expo init to make my first react native app in my command prompt, and run the app with expo start. But now when i have some new project to make with the 'expo' command like expo init or expo start or something else, it didn't work anymore. When i tried to type and enter the expo command, its always be
'expo' is not recognized as an internal or external command, operable program or batch file.
And now when i tried to update the expo-cli with npm install -g expo-cli a warning of error appeared.
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli
npm ERR! dest C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\ACER\\AppData\\Roaming\\npm\\node_modules\\expo-cli',
npm ERR! dest: 'C:\\Users\\ACER\\AppData\\Roaming\\npm\\node_modules\\.expo-cli-foqoNR8w'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ACER\AppData\Local\npm-cache\_logs\2021-01-10T17_18_03_575Z-debug.log
This preventing me from doing the installation of react navigation and make a new project by using 'expo' command. And i've been search this problem on and tried to solve it but it didn't work on any various ways that i've tried. I've tried to reinstall the expo-cli but it didn't work, i've tried to use yarn as well but still it didn't work. I've been re-added the path for the npm and even tried to reinstall nodejs and use any various code for updating and installing the 'expo-cli' but it didn't work as expected.
Any suggest on how do i can fix this problem ?
Run your command line as Admin and then do the following:
npm remove -g expo-cli to remove the existing CLI
and then npm i -g expo-cli to reinstall the Expo CLI.
Then you can simply login via expo login (if you were logged in) and take off from where you were!
I delete the expo file on the path :
C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli
C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w
the file that i deleted : expo-cli & .expo-cli-foqoNR8w
And then try to install the expo-cli again with npm install --global expo-cli then it work. Now i can use my expo start or whatever code with 'expo' in it. And also now i can install react navigation on my project directory. And i'm running the installation by using command prompt run as admin.

The NativeScript Plugin Seed Demo Does Not Run

We are trying to use our native codes in Nativescript therefore we tried to test nativeScript plugin seed. We follow the steps to in README however demo does not run and stops.
We tried all available version we could reach and applied the flow we see in guidance videos.
Last section of terminal messages:
Webpack compilation complete. Watching for file changes. Webpack build
done! Copying template files... Unable to apply changes on device:
F2CB7B69-FE7F-4EE7-9150-133E604FBF18. Error is: zlib: unexpected end
of file. npm ERR! code ELIFECYCLE npm ERR! errno 134 npm ERR!
nativescript-tstpin#1.0.0 demo.ios: npm run tsc && cd ../demo && tns
run ios --syncAllFiles --emulator npm ERR! Exit status 134 npm ERR!
npm ERR! Failed at the nativescript-tstpin#1.0.0 demo.ios 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: npm ERR!
/Users/hasanguner/.npm/_logs/2019-05-22T08_53_09_212Z-debug.log
Hasans-MacBook-Pro:src hasanguner$
After the messages in the terminal it stops. It would be great if anyone could help how to step over this starting point.
Solved. I tried the following: On Mac:
sudo npm cache clean --force
Then worked fine.
If anyone tells me the reason it would be perfect.

How can i run a demo React Native Code on Phone

Im totally new to React Native and just learned to setup the necessary environments and follow these steps;
Install Node.js
Download Expo client at mobile device
npm install -g create-react-native-app
cd to my desired directory
create-react-native-app some_app_name
cd to my app folder containing default app.js
npm start
basic / empty app will be loaded on my phone and code can be opened using editor of choice.
Now i've downloaded some demo simple apps from github and udemy (with full source code)
I tried to extract the files and cd to the folder and execute "npm start"
However, there is always this error
react-native-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! demo_app#0.1.0 start: react-native-scripts start
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the demo_app#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
May i know what is missing? How do i get this right?
The command to run a react-native app is react-native run-android for android devices and react-native run-ios for ios devices. Are you sure that you are running these commands to start the app?
Seems like this might be a duplicate of:
sh: react-scripts: command not found after running npm start

Error when using 'create-react-native-app'

I tried to create a new React Native app using the command create-react-native-app in the node.js terminal on my Windows system. I got the following terminal error:
D:\project>create-react-native-app crna
Creating a new React Native app in D:\project\crna.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Suppor
t
npm WARN deprecated #exponent/spawn-async#1.2.8: Please switch to #expo/spawn-as
ync, the new name of this package. It's the same code with our new name.
npm ERR! shasum check failed for C:\Users\ui-admin\AppData\Local\Temp\npm-3204-a
eacedd1\registry.npmjs.org\_40exponent\ngrok\-\ngrok-2.2.7.tgz
npm ERR! Expected: 37fe66f922b1003da2a78c66b7d4d3bc9313e423
npm ERR! Actual: d134060eb730b880da06d5c040ca933f6a75b613
npm ERR! From: https://registry.npmjs.org/#exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ui-admin\AppData\Roaming\npm-cache\_logs\2017-05-26T09_36_
04_379Z-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed
Anyone met this error or fix it?
I got the same error, though in RubyMine, which provided the response that react-native doesn't work with npm 5 yet. it said you can either revert to npm 4 or feel free to log an issue here: https://github.com/npm/npm/issues/16991
I think you're best bet would be to revert and wait it out!