How do I fix this error?
Unhandled JS Exception: Requiring unknown module "1". If you are sure the module exists, try restarting Metro. You may also want to run yarn or npm install.
I installed react-navigation, react-native-elements through npm when I believe the error occurred. So I uninstalled them and I still get the same error.
I also ran yarn and npm install
Here are my dependencies
"dependencies": {
"#react-native-firebase/app": "^8.2.0",
"#react-native-firebase/auth": "^8.2.0",
"react": "16.13.1",
"react-native": "0.63.0"
}
app.js and the error screen
hello you just need to put ctrl+c in your termial so you can stop the server
than tap
npm start
or
yarn start
You have some syntax error probably
Attach snippets of App.js and the exact error stack trace you are getting with screenshots if possible.
Setup your node_modules from scratch again
Execute these:
1. rm -r node_modules
2. rm package-lock.json
3. expo upgrade
4. npm start -c
And install your dependencies once again either with npm or yarn.
Note: Use any one (npm or yarn)
Related
I am using react native and Expo. I am unable to build new app because after I use expo init appName it shows the following error.
Heres the full message:
📦 Using npm to install packages. You can pass --yarn to use Yarn instead.
√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
I tried multiple times to create a blank project, also tried npm install to install failed/not downloaded libraries and continue after failure but it showed another error:
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
also tried npm cache verify that showed cache is ok Content verified: 3562 (252580364 bytes).
So, How can I solve this issue?
Problems related to npm installation are very common If you do any mistake in early installation, but is avoided. Learn more about npm tree.
Steps worked for me are :
npm cache clean --force
npm cache verify
npm -g uninstall expo-cli --save
npm install expo-cli --global
expo init app-name
cd app-name
npm start
Always run as administrator if working on Windows and in root directory.
The solutions above didn't work for me but if you use 'npm install' in the directory of the app you get a clue that you shuold try 'npm install --force'
err message
You should have all these files folders and files at the start of the project otherwise not all the dependencies have been installed which is why we were getting the problem.folder structure
After you have added --force to npm install you have all the dependencies installed. Now you can run the app with npm start.
Unfortunately, all the solutions described above didn't work on my machine...
Here is my latest solution for this problem...
This worked 100% on my machine...
Use npm i -g expo-cli
This will automatically add the required packages and also remove the unnecessary ones.
Yes, surely, you don't need to uninstall and re-install it again.
Just follow my steps.
And, you can create your expo project using expo init.
I hope my solution will help you out from this annoying problem....
I just did npm install and it worked for me, but I had do that every time I create a new expo project.
I also encountered this problem, and finally found that it was the problem of react native cli,I installed the latest version of react native cli,Expo is back to normal
This Error is regarding to the git account. expos need a git account to setup react native project
If you are using windows you need to install git in your local PC
after that open your Terminal and type this command
git config --global user.name "your_username"
git config --global user.email "your_email_address#example.com"
after that clone any github project to your local computer. it will ask to login to Github
after all these steps try expo init <projectname>
The simple way to settle that error is by using "expo-cli init app-name" instead of "expo init app-name".
I tried and worked perfectly for me. Hope it will help you guys.
i have faced a similar problem and running yarn set version 1.22.1 fix it
Run the Command Prompt as an administrator. And run the following command:
npx create-expo-app AwesomeProject
This is the error log. And I cannot for the life of me fix this. everything works fine in dev but on deployment it fails. :(
23:12:53.687 Failed to compile.
23:12:53.687 ModuleNotFoundError: Module not found: Error: Can't resolve '../../styles/Homebody.module.css' in '/vercel/workpath0/components/Home'
23:12:53.687 > Build error occurred
23:12:53.688 Error: > Build failed because of webpack errors
23:12:53.688 at /vercel/workpath0/node_modules/next/dist/build/index.js:15:918
23:12:53.689 at runMicrotasks (<anonymous>)
23:12:53.689 at processTicksAndRejections (internal/process/task_queues.js:93:5)
23:12:53.689 at async /vercel/workpath0/node_modules/next/dist/build/tracer.js:3:470
23:12:53.704 npm ERR! code ELIFECYCLE
23:12:53.704 npm ERR! errno 1
23:12:53.707 npm ERR! next_front#0.1.0 build: `next build && next export`
23:12:53.707 npm ERR! Exit status 1
23:12:53.707 npm ERR!
23:12:53.707 npm ERR! Failed at the next_front#0.1.0 build script.
23:12:53.707 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
23:12:53.714 npm ERR! A complete log of this run can be found in:
23:12:53.714 npm ERR! /vercel/.npm/_logs/2021-02-24T23_12_53_708Z-debug.log
23:12:53.719 Error: Command "npm run build" exited with 1
One thing is to start all .module.css files with a capital letter. Sometimes. however, you will still get the same error. To make matters worse, the error keeps occurring for varying .module.css files. So sometimes you will get A.module.css not found, and another time you get B.module.css not found.
I then deleted node_modules and ran npm i. No result; same error.
What did work for me was to make a new project with:
yarn create next-app
…and then add all the files from the old module one by one while redeploying the app each time to check it still works.
This isn't elegant, but it's fast enough and it does the trick.
This is an old question but I hope I can help someone in the future!
I was able to solve this issue by moving my CSS module file out of a subfolder into the root Styles folder.
Before:
-Styles
--Pages
---FileName.module.css
After:
-Styles
--FileName.module.css
My package.json file includes these lines:
"angularfire2": "^4.0.0-rc.1"
"firebase": "^4.1.3"
When I try to install this, I get a warning:
npm WARN angularfire2#4.0.0-rc0 requires a peer of firebase#^3.6.6 but none was installed.
So I tried changing the second line to "firebase": "^3.6.6" but then I get:
npm WARN angularfire2#4.0.0-rc.1 requires a peer of firebase#^4.0.0 but none was installed.
Now, I know I can fix this by removing the ^ from the first line, but I don't understand the behavior as it's currently written.
Why is it not only sometimes going back a version when it should only go forward, but also always picking the wrong one for the Firebase version?
Try npm install firebase#4.0.0 --save
Grunt release : Warning: Task "release" not found and shows aborted due to warnings.
But it shows hint like "Use --force to continue". If i use "--force" to the command it is working fine. What's happening when i use --force before and after.
Double check that all the dependencies for your project are properly installed by running npm install. If there's errors, update your question with that information.
If that does not resolve the problem, check package.json for the grunt-release plugin. It will be found under dependencies or devDependencies. If it's missing from package.json, run npm install grunt-release --save-dev to install the plugin and save it to your project dependencies.
If any errors occur while attempting to resolve your problem this way, update your question and include that information.
I've looked high and low for how to fix this, couldn't figure it out.
Running a React - Meteor app, meteorhacks:npm and browserify.
Error:
While building package npm-container:
error: couldn't run `npm shrinkwrap`: Command failed: npm ERR! Error: Problems were encountered
npm ERR! Please correct and try again.
npm ERR! missing: react#^0.14.7, required by react-addons-transition-group#0.14.7
npm ERR! missing: react#^0.14.7, required by react-addons-update#0.14.7
npm ERR! missing: react#^0.14.7, required by react-addons-create-fragment#0.14.7
npm ERR! missing: react#^0.14.7, required by react-addons-pure-render-mixin#0.14.7
npm ERR! at shrinkwrap_
Packages.json
{
"externalify" : "0.1.0",
"react-tap-event-plugin": "0.2.2",
"react-mixin" : "3.0.3",
"material-ui" : "0.13.4",
"formsy-react" : "0.17.0",
"formsy-material-ui" : "0.3.3"
}
The strange thing though is I had this working, then once I tried updating from material-ui 0.13.4 to 0.14.4, the whole package stopped working. I then reverted back to 0.13.4 and the same error persisted. I've tried removing meteorhacks:npm and the npm-container folder, as well as clearing npm cache.
The error disappears if I downgrade material-ui to 0.13.1, though I'm still trying to fix as I need to upgrade to 0.14.
I finally solved it. The only way I found was to upgrade meteor to the 1.3 beta, which includes modules import, so I could remove npm-package.
There was a bit of refactoring, where you have to remove any packages which load react, import the relevant packages on every jsx file, and another small bug caused by material-ui (again) with npm (it loads react as well so you need to delete react folder from your_project/node_modules/material-ui/node_modules/react).