Cannot find module ‘#expo/metro-config’ when trying to start the project with expo cli >= 4.8.0 - react-native

I recently tried to launch my project on a new computer. I downloaded the source code from its repository and ran npm install to get all the needed packages.
However, when I run npm start or expo start:web, I get the error:
Cannot find module '#expo/metro-config'
I ran npm install #expo/metro-config and the install run without issue, but I still get the “Cannot find module '#expo/metro-config'” error.
The only post I saw regarding this error recommends editing the metro.config.js but I do not use one.
I am on SDK 42, and the project launches fine on my other computer. Any idea what is happening?
FYI, I use to perform this whole operation without any issue until now.
UPDATE:
I ran npm install -g #expo/metro-config and now I get the error Cannot find module 'resolve-from'
So it looks like maybe running npm install -g expo-cli doesn't actually install all the necessary packages? Could it be the issue?
I managed to make it "work" (get other missing packages errors down the line) by reverting to expo-cli 4.7.3. Anything from 4.8.0 and above will cause the error.
Something else is that on a fresh npm install, after running npm install -g expo-cli, if I try to create a project with expo init, I will get the error Error: Cannot find module 'kleur'. Running npm install kleur fix it, but maybe that's also a clue.

Related

Error while I create a new Npm project it says error while installing dependencies

enter image description here
While creating a npm project I am getting this error.
But when I install yarn.
I don't know how to rerun the program.
Or is it because I installation problem.
Is using the latest version of node an issue.
Can Someone help me with this?
the strapi supports node version up to 18, you can check it here https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/installation/cli.html#preparing-the-installation
there is flag for npm you can try to use:
npx create-strapi-app /appname --ignore-engines
However I doubt it would work, the workflow with yarn:
yarn create strapi-app /appname
If error still persists you can try to open your project with VS code or whatever IDE you use… Open terminal, do:
yarn --ignore-engines
yarn build --ignore-engines
yarn develop --ignore-engines
If that won’t help, it should give you another, more detailed error message that you should post then here…

Running my first truffle file, Cannot find module 'babel-register'

I am working on building the marketplace dapp from dapp university on Youtube. While running truffle compile it gives me the following error
Error: Cannot find module 'babel-register'
In this answer: Error: Cannot find module 'babel-register' someone suggested that I delete package-lock and do npm install again.
but when I searched up how to delete package-lock,I found this Deleting `package-lock.json` to Resolve Conflicts quickly which pretty much says that "don't ever delete package-lock.json."
I am a beginner, any help is appreciated.
Keep in mind that some of the dependencies in that source code are outdated.
I avoided this specific issue by running npm audit fix --force after npm install
I then ran npm install -g npm-check-updates to update all of the packages.
ncu -u will also upgrade those dependecies directly in the json.
Finally, npm update
truffle compile should now work as expected.
Good luck in your blockchain development! I'm just starting myself :)

Mongo-express | Patch file found for package mongodb-query-parser

I am trying to get rid of the following error message.
patch-package 6.2.2
Applying patches...
Error: Patch file found for package mongodb-query-parser which is not present at node_modules/mongodb-query-parser
This message appears when I try to install mongo-express. Locally this is no problem, because npm install keeps progressing after the error message.
But when I try to run it on gitlab-pipeline it exits the job.
Is there any workaround?
Temporary quick fix is to install mongo-express without the postinstall.
npm install mongo-express --ignore-scripts && npm install
That way the patch-package isn't called and at least the CI doesn't break. But I'm not sure how unsecure this is...
Hopefully going to be fix soon! I opened an issue
Cheers

RN Expo issue - Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app

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

Cannot start ReactNativeProject

I followed the tutorial in the link here https://facebook.github.io/react-native/docs/getting-started.html#content . As it turns out, npm 5 is not supported yet. I tried installing npm 4 but, it is not working either. Stuck in the first page of the tutorial, when I run npm start, I am getting a bunch of errors too. Literally stuck, nowhere else to turn. Before voting down the question, kindly note that I am a mobile developer working with andorid and Ios having no previous knowledge about web technologies. Thanks
These are the steps I followed
npm install -g create-react-native-app
It was successfull, then,
create-react-native-app AwesomeProject
for this line, I got the following error
*******************************************************************************
ERROR: npm 5 is not supported yet
*******************************************************************************
It looks like you're using npm 5 which was recently released.
Create React Native App doesn't work with npm 5 yet, unfortunately. We
recommend using npm 4 or yarn until some bugs are resolved.
You can follow the known issues with npm 5 at:
https://github.com/npm/npm/issues/16991
*******************************************************************************
Then I ran the command
cd AwesomeProject
Afterwards I ran
npm start
for which I got the error
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jayakrishnan/.npm/_logs/2017-07-25T08_13_06_277Z-debug.log
I tried using Yarn But didnt work
npm i -g npm#4.6.1 - then install create-react-native-app again and create a project.
Solution with Yarn:
First install Yarn
yarn global add create-react-native-app
cd AwesomeProject
yarn start
npm install -g npm#4 Use this to downgrade, Also use sudo with the commands, sometime it does give permission to write error and skips the installation
Try putting more information about the error so we can help, or steps to reproduce it.
One thing to try is to instead of using npm, use yarn. Install yarn with brew install yarn if you are on mac and do the same steps in the getting-started guide, except for use yarn run ios to start app in ios simulator.
I just tried with a fresh setup that this is working perfectly fine.
Reference to yarn https://yarnpkg.com/en/