Unable to find expo in this project - have you run yarn / npm install yet? - npm

I'm Unable to execute the expo start command.
Error Message:
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> expo start
Starting project at C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project
Unable to find expo in this project - have you run yarn / npm install yet?
├─ action (C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:34:11)
├─ C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:135:22
└─ expo start (C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:350:7)
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> npm install
added 28 packages, removed 46 packages, changed 34 packages, and audited 653 packages in 8s
17 packages are looking for funding
run `npm fund` for details
7 low severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> npm audit
npm audit report
node-fetch <=2.6.0 || 3.0.0-beta.1 - 3.0.0-beta.8
Denial of Service - https://npmjs.com/advisories/1556
No fix available
node_modules/isomorphic-fetch/node_modules/node-fetch
isomorphic-fetch 2.0.0 - 2.2.1
Depends on vulnerable versions of node-fetch
node_modules/isomorphic-fetch
fbjs 0.7.0 - 1.0.0
Depends on vulnerable versions of isomorphic-fetch
node_modules/fbjs
metro 0.22.1 - 0.63.0
Depends on vulnerable versions of fbjs
Depends on vulnerable versions of metro-config
node_modules/metro
#react-native-community/cli *
Depends on vulnerable versions of metro
Depends on vulnerable versions of react-native
node_modules/#react-native-community/cli
react-native <=0.0.0-ffdfbbec0 || 0.22.0-rc - 0.64.0-rc.4
Depends on vulnerable versions of #react-native-community/cli
Depends on vulnerable versions of fbjs
node_modules/react-native
metro-config <=0.63.0
Depends on vulnerable versions of metro
node_modules/metro-config
7 low severity vulnerabilities\
Some issues need review, and may require choosing
a different dependency```

Change expo version from "^1.0.0" to "~41.0.1" (package.json)
npm install
npm start

if anyone is still facing issues, run
yarn add expo
if you don't have yarn installed on your computer then run
npm install -g yarn
and then run the first command.

I also received your message when installing the commands in the "React Navigation" set-up instructions and fixing vulnerabilities. The problem arises when using the command: npm audit fix --force. If you check the warnings after this command, you get
npm WARN audit Updating expo to 1.0.0, which is a SemVer major change.
So, try running: sudo expo update
If that doesn't work, try installing expo again with: npm install --global expo-cli and then update.

I'm also facing this error. So I run the npm command in the terminal.
npm install
You do not need to change the expo version. you just reinstall it.

Update the Expo to the latest version sudo expo update
Then install the updated npm packages npm install
Fix the issues in the packages npm audit fix --force
Run the Application npm start or expo start

Error ? you are trying to launch the expo framework yet it can't be found installed as part of your application modules
solution? simply find the latest version of Expo i.e for my case "expo": "^44.0.0", then go to your package.json file in your root folder, under the "dependencies" property plug-in that Expo version i.e
"dependencies":{
"expo": "^44.0.0",
}
close package.json file, then in your root folder run the command: npm install
after package installation is done run expo start

I simply used the expo update command.
It asked me
You are currently using SDK 1.0.0. Would you like to update to the
latest version, 44.0.0?
and I said yes, y not..
Every Thing was good to go with the npm start command
Cheers..

See the expo version - default "^1.0.0" , change ==> "expo": "~41.0.1"

Change expo to version "~43.0.0" in package.json
run npm audit fix --force in node_modules directory

here are my 2 cents. This worked for me :
Download latest version of nodejs - https://nodejs.org/en/download/
After installing nodejs reboot your computer
install : npm install --global expo-cli
Generate a new project with - npx expo-cli init projectName
cd projectName
npm start

you can run the below to install all dependencies
npm i
or to install exp
npm i -g expo-cli

This problem I faced was because of cloning a new project and trying to run it.
Always install the modules using the below command
I solved this by
npm install or npm i

I had same problem.
I simply used the expo update command.
You are currently using SDK 1.0.0. Would you like to update to the latest version, 44.0.0?
and I said yes.
Every Thing was good to go with the npm start command
thats all

Is possible that you need an update try this command:
sudo expo update

Please try this
npm install --save expo --legacy-peer-deps
no need to edit package.json if expo version is not 1.0.0

You should register first on expo and then login
I had the same issue but after I logged in it was solved.
here is all about : https://docs.expo.dev/get-started/installation/

In my case, I clonned a Github repository and then used create-expo-app inside the repository directory. So, the command created a directory with the name of the app, but I was not in it: I was running the expo run command in the wrong directory.
Double check that the package.json is in the same directory in which you are running yarn or expo run to avoid this simple mistake.

The same error happened to me. But none of the other answers helped me. In my situation, I have node.js v18.12.1 installed. But when I check with nvm ls, the arrow points to "system", and on my system Xubuntu 22.04, the nodejs version installed is v12.22.9. So I needed to do nvm use 18, then
yarn add expo
expo start
Problem solved!

for window users
just type expo update into your terminal,

Related

error installing cypress on windows 64 with npm

I'm seeing an error when attempting to install the latest cypress on my Windows 10 machine. I was using cypress 8.7 just fine. I deleted node_modules and package-lock.json and removed "cypress": "^8.7.0", from package.json.
Now installing cypress (9.1) I see this error:
npm install --save-dev cypress
npm ERR! Error: Cannot find module 'har-validator'
I see the same error when trying to use the old version too
npm install --save-dev cypress#8.7.0
System info from powershell:
node -v
> v16.8.0
npm -v
> 7.21.0
UPDATE:
My friend is able to install with dependency 8.7.0 in package.json, on OSX with nodejs 14.16.0.
This works today (2021-11-26) for me
npm install --save-dev cypress#8.7.0
There is a Bug in #cypress/request.
Take a look at https://github.com/cypress-io/request/pull/15
EDIT: There is a PR from one of the devs. https://github.com/cypress-io/request/pull/16
Looks like Cypress issue with latest versions. we have this problem for v8.7.0 today. "npm install har-validator" manually installed the missing har-validator module, that helped.

Globally installation of packages with npm

I have a question regarding the package manager npm and the meaning of installing the package globally.
For example I work often with react, should I install react globally?
npm install -g react react-dom
Does this mean that next time when I do
npx creat-react-app my-app
It will get the package from the global or it does not matter and it will still download it locally inside my-app?
Because I really do not understand the idea behind installing globally.
Because if I want to use a package it should be mentioned in package.json, if it is in package.json it is then located in node_module ... so yeah ...
Could anyone give me better insight?
Thanks in advance
React library can be installed globally on your local machine. In development there is no real reason to do that since you might not have the latest version and this might cause issues.
Better practise is to use react on project level by using the command you stated above npx create-react-app my-app
If you push code to a server the package.json file will install the dependencies (React, React DOM,..) to build your project.
Read more here : https://create-react-app.dev/docs/getting-started/
If you've previously installed create-react-app globally via npm
install -g create-react-app, we recommend you uninstall the package
using npm uninstall -g create-react-app or yarn global remove
create-react-app to ensure that npx always uses the latest version.
You can check what packages are installed globally using:
npm list -g --depth 0

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 find module 'expo/bundleNativeModules.json'

I'm using expo to build an app. I'm new to React-Native and expo so if you could help me, I'd be really appreciated.
I get a couple of warnings that says:
Some of your project's dependencies are not compatible with currently installed expo package version
- expo-constants - expected version range: ...
- expo-permissions - expected version range: ...
- react-native-gesture-handler - expected version range: ...
Your project may not work correctly until you install the correct versions of the packages.
I was facing another error:
"TypeError: TypeError: undefined is not an object (evaluating '_styles.default.list')".
So I'm trying to install the latest version.
When I try to install expo install expo-permissions and expo install react-native-gesture-handler, I get errors.
Both errors say
Cannot find module 'expo/bundledNativeModules.json'
Require stack:
- /Users/address/src/react-native-udacicards/noop.js
I tried to remove node_modules and package-lock.json then npm install.
rollback with npm install -g expo-cli#2.4.3
I don't know if this solution will work for all the situations, but this is what fixed the issue it for me:
clean the npm cache using the following command : npm cache clean --force
re-install the dependencies : npm install
expo install
I hope it helps
1.on your package.json change expo version to
"expo": "~43.0.2", (or lower)
and your react-native-gesture-handler to
"react-native-gesture-handler": "~1.10.2",
(for expo 43.0.2)
Then, on your terminal (in your project), run
npm cache clean --force
npm install
expo doctor --fix-dependencies
I also faced this issue but Enableing USB tethering in phone, and clearing all data in expo app resolved this issue.

NPM Cannot read property '0' of undefined

After updated Node (upto v8.6.0) and npm (upto v5.5.1) I cannot execute command npm install.
After npm install I've error message:
npm ERR! Cannot read property '0' of undefined
What's trouble or I need downgrade node/npm ?
I had the same problem.
I removed both node_modules and package-lock.json and then did:
npm install
And it worked.
Edit by #OwlyMoly
Due to new updates and the restriction to old dependencies in package-lock.json is causing this conflicts. By doing npm install won't fix this issue. Instead by ditching npm_modules and package-lock.json and doing npm install will load a new node_modules and that supposed to be required by package.json. You have to commit the new package-lock.json along with your latest changes of the project.
Do 2 steps bellow (Window):
rm -rf ./node_modules to remove node folder
rm package-lock.json to remove package-lock.json file
then npm install to re-install the node modules
Just download and install latest Yarn which is also a node package manager, developed by facebook, but has a much better dependency management. Also update your node cli (optional).
And then, install your dependencies using yarn:
yarn install
or
yarn // short version of yarn install
No errors!
You can continue to use npm after you have installed all dependencies with yarn or continue with yarn....it's your choice.
I've made some tests:
nodejs#8.6.0 npm#5.5.1 - I have trouble and the test fails
nvm use 8.5.0
nodejs#8.5.0 npm#5.5.1 - I have trouble and the test fails
nvm use 8.4.0
nodejs#8.4.0 npm#5.5.1 - I have trouble and the test fails
npm install npm#^5 -g
nodejs#8.4.0 npm#5.4.2 - I have trouble and the test fails
nvm use 8.6.0
npm install npm#^4 -g
nodejs#8.6.0 npm#4.6.1 - no trouble, this fixes it.
Seems to be an issue with a combination of factors.
Some workarounds here:
https://github.com/npm/npm/issues/18238
npm 5.3.0 is broken for windows 10 after upgrading the nodeJS.
You should downgrade the npm, it is a temporary solution but works fine.
npm install -g npm#5.2.0
For me (npm#6.9.0) solved the issue by deleting node_modules and performing npm install, but without removing package.json.lock file.
Just remove both node_modules and package-lock.json and run: npm install
or
Just run: npm install -g npm#latest to upgrade it to the latest version
Try with nvm(Node Version Manager).it help you to install any node version for any project without any Error.
I found same problem when using npm version 5.5.1 to install babel-preset-stage-0
Solution:
I downgraded npm to version 5.2.0 and try to install again then it can solve the issue.
npm i -g npm#5.2.0
npm i -D babel-preset-stage-0
I bumped into this issue using nvs (Node Version Switcher - https://github.com/jasongin/nvs) node#10.15.3 and npm#6.9.0. The reason was a local package I had linked with npm link. The solution was to remove that folder.
In my case reinstalling node_modules have not fixed this issue.
Problem was with one *.ts file which was missing in source codes.
Do not know why It was not displaying compilation error, but adding this missing file to repository solved this issue.
Upgrading npm to version 7.5.4 did the job for me.
npm install -g npm#latest
What worked for me:
npm ci
Install a project with a clean slate
docs: https://docs.npmjs.com/cli/v7/commands/npm-ci
Deletes node_modules and installs everything based on package-lock.json, so no need to regenerate that