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.
I have published a package to the Gitlab NPM registry and now I am attempting to install the package into another project.
When I run in terminal:
yarn add #org-name/project or npm i #org-name/project
I get (4x):
info There appears to be trouble with the npm registry (returned undefined). Retrying…
Then after the 4 attempts above in the terminal I get:
ResponseError: Request failed “503 Service Unavailable”
I have authed to Gitlab and the group as I was able to publish the package and followed each step here: https://docs.gitlab.com/ee/user/packages/npm_registry
Any ideas at all as to why I can publish but not download the same package from the same repo or any other repo??
Thank you so very much in advance!
The issue turned out to be a typo on my part. Le sigh.
I am currently using npm task in my build pipeline in azure devops.
Recently the npm run step started failing with below error. When I manually install the sass and sass-loader the npm run step passes without any error. How can I install the complete modules from pipeline.?
ERROR in Module build failed (from ./node_modules/#angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js):
You can try the following ways to see if the problem can be solved:
Execute the npm install command to install the node-sass (see here) in the pipeline.
npm install -D node-sass
Reconfigure your npm package on the local machine.
Install or upgrade Angular to the latest version.
Check out the source repository to the local machine.
Remove the nose modules and the package lock.
Reinstall the refresh dependencies for your package via the npm isntall command.
Push the changes to the remote repository, then try the pipeline.
I have fixed the issue by adding another step with npm task and passed and argument(sass-loader) to install the sass modules.
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
I'm trying to install an NPM package called Bulksplash. But I have no idea how to install it. I've tried using several guides on general package installations but they're bit tech savvy and I couldn't understand it.
https://github.com/MehediH/Bulksplash
If possible, can anyone please help me how to install this on my Mac? Thanks in advance.
Using the view command, i.e. running:
npm view bulksplash
via the macOS "Terminal" application reports:
npm ERR! 404 'bulksplash' is not in the npm registry.
Therefore you'll need to install the package from Github directly, as per this answer.
i.e. Run the following command in your "Terminal" application:
npm install git+https://github.com/MehediH/Bulksplash.git