Error: ENOENT: no such file or directory, open 'fs.js

Viewed 3596

I am working in React Native using expo-cli.

All I did till now is

expo init myapp

And after adding a text to my app.js file, I tried to do

npm start

which gave me this error

Error: ENOENT: no such file or directory, open 'fs.js

I have not used anything related to fs.js and as far as I can see from the errors page, the error is in

.../node_modules/metro/src/Server.js:99:24)

And other file stack system is referring it to metro. I am using VS code and Linux Mint for development. My expo version is: 4.3.0

The result of expo diagnostics

Expo CLI 4.3.0 environment info:
    System:
      OS: Linux 5.4 Linux Mint 20.1 (Ulyssa)
      Shell: 5.0.17 - /bin/bash
    Binaries:
      Node: 10.19.0 - /usr/bin/node
      npm: 6.14.4 - /usr/bin/npm
    npmPackages:
      expo: ~40.0.0 => 40.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2 
      react-native-web: ~0.13.12 => 0.13.18 
    npmGlobalPackages:
      expo-cli: 4.3.0
    Expo Workflow: managed
2 Answers

try to start as an administrator with sudo yarn start

I managed to solve it here but I'm not sure what caused this problem. first i restarted the computer, when i did this another error similar to this one appeared How can i make this working. I tried giving sudo permissoins

so I ran

chmod -R 0777 / tmp

But it didn't work. so I deleted the node module and ran

sudo yarn install
yarn start --reset-cache

And the problem was solved

Related