React-native: Cannot find module 'C:\Users\USER\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js

Created on 25 Sep 2019  路  29Comments  路  Source: facebook/react-native

Immediately after updating node i got an error of
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: node installArchSpecificPackage
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Roaming\npm-cache_logs\2019-09-25T17_14_47_778Z-debug.log

Someone on stackover flow suggested to me to remove the folder of Node_module..now I'm getting two errors module not found and that i posted above

Bug Ran Commands

Most helpful comment

Hey guys,

npm install -g expo-cli --force

Works for me.

All 29 comments


Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

馃憠 Click here if you want to take another look at the Bug Report issue template.

update node to the latest LTS version as the documentation suggests. you can download that from https://nodejs.org/en/download/

nodejs 8 is not supported

update node to the latest LTS version as the documentation suggests. you can download that from https://nodejs.org/en/download/

Thanks. This helped. Encountered the same problem

* I still have the error *

```Amoory@S MINGW64 ~/Desktop
$ expo init my-new-project
internal/modules/cjs/loader.js:797
throw err;
^

Error: Cannot find module 'C:\Users\Amoory\AppData\Roaming\npm\node_modules\expo- 
cli\bin\expo.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
   requireStack: []

}```

* I still have the error *

```Amoory@S MINGW64 ~/Desktop
$ expo init my-new-project
internal/modules/cjs/loader.js:797
throw err;
^

Error: Cannot find module 'C:\Users\Amoory\AppData\Roaming\npm\node_modules\expo- 
cli\bin\expo.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
   requireStack: []

}```


Amoory@S MINGW64 ~/Desktop
$ node -v
v12.13.0

Amoory@S MINGW64 ~/Desktop
$ npm -v
6.12.0

Amoory@S MINGW64 ~/Desktop
$ npm doctor
npm notice PING https://registry.npmjs.org/
npm WARN verifyCachedFiles Content garbage-collected: 50 (24927770 bytes)
npm WARN verifyCachedFiles Cache issues have been fixed
Check                               Value                                     Recommendation
npm ping                            ok
npm -v                              v6.12.0                                   Use npm v6.13.1
node -v                             v12.13.0                                  Use node v12.13.1
npm config get registry             https://registry.npmjs.org/
which git                           C:\Program Files\Git\mingw64\bin\git.EXE
Perms check on cached files         ok
Perms check on global node_modules  ok
Perms check on local node_modules   ok
Verify cache contents               verified 2991 tarballs


tengo el mismo problema

I also have the same problem I ran the command and got an error message just like that

I found the solution just run it in your user folder because it does not respond when you ran it in a different directory other than maybe C:\Users\User_Name

plzzz help ,,,,,,errorr

internal/modules/cjs/loader.js:957
throw err;
^

Error: Cannot find module 'C:\Users\mehta\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js'
 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:954:17)
 at Function.Module._load (internal/modules/cjs/loader.js:847:27)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:67:12)
 at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

plzzz help ,,,,,,errorr

internal/modules/cjs/loader.js:957
throw err;
^

Error: Cannot find module 'C:\Users\mehta\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js'
锟絒90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:954:17)锟絒39m
锟絒90m at Function.Module._load (internal/modules/cjs/loader.js:847:27)锟絒39m
锟絒90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:67:12)锟絒39m
锟絒90m at internal/main/run_main_module.js:17:47锟絒39m {
code: 锟絒32m'MODULE_NOT_FOUND'锟絒39m,
requireStack: []
}

try with cmd in user files

I have the same problem trying to install the expo. I am using node v13.2.0. Reproducing it on 2 different systems

I had the same error, so I tried to reinstall expo-cli globally and noticed there's an error with [email protected].

There's another GitHub issue regarding the envsub error and the solution there solved the "cannot find module" for me. Reinstalling expo with git bash (Windows) did the trick.

https://github.com/expo/expo-cli/issues/1284#issuecomment-560019506

Tuve el mismo error, as铆 que intent茅 reinstalar expo-cli a nivel mundial y not茅 que hay un error con [email protected].

Hay otro problema de GitHub con respecto al error envsub y la soluci贸n all铆 resolvi贸 el "no se puede encontrar el m贸dulo" para m铆. Reinstalar expo con git bash (Windows) hizo el truco.

expo / expo-cli # 1284 (comentario)

Como hiciste para resolverlo? lo de expo-cli

Hey guys,

npm install -g expo-cli --force

Works for me.

You just have some files missing so you need to install all the packages needed, try this out :

npm install mysql @types/mysql

I have this error. please help

react-native : File C:\Users\bawan\AppData\Roaming\npm\react-native.ps1 cannot be loaded because running scripts is disabled on this system. For more information,
see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • react-native run-android
  • ~~~~

    • CategoryInfo : SecurityError: (:) [], PSSecurityException

    • FullyQualifiedErrorId : UnauthorizedAccess

I have this error. please help

react-native : File C:\Users\bawan\AppData\Roaming\npm\react-native.ps1 cannot be loaded because running scripts is disabled on this system. For more information,
see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

react-native run-android

  • CategoryInfo : SecurityError: (:) [], PSSecurityException
  • FullyQualifiedErrorId : UnauthorizedAccess

npm install -g expo-cli --force

Works for me. too

tks @lucashdp

Hey guys,

npm install -g expo-cli --force

Works for me.

Works for me as well

Hey guys,

npm install -g expo-cli --force

Works for me.

thank you very much, it works for me too

Hi,
npm install -g expo-cli --force

works for me too..

Thanks

none of the above answers works for me :(

Hello,
npm install -g expo-cli --force

works for me too..

Thank you

hello
npm install -g expo-cli --force
it works
thanks

npm install -g react-native-cli --force
with that i achieved run my app when i had this problem.

I had the same problem. It was due to expo cli script being installed into C:\Program Files\nodejs instead of the AppData location. To fix do the following on Windows :

C:>where expo
C:\Program Files\nodejs\expo
C:\Program Files\nodejs\expo.cmd
C:\Users\anand\AppData\Roaming\npm\expo
C:\Users\anand\AppData\Roaming\npm\expo.cmd

You need to make sure that the expo cli being found is the correct one. In the case above, i just renamed C:\Program Files\nodejs\expo and expo.cmd and everything started working.

I am facing a problem when create a rect native project

C:\Users\FizaWaseem>node --version
v12.16.3

C:\Users\FizaWaseem>npm --version
6.14.4
-----------------------here is proble--------------
PS F:\React-native\APP> expo init AwesomeProject
internal/modules/cjs/loader.js:960
throw err;
^

Error: Cannot find module 'C:\Users\FizaWaseem\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

none of the above answers works for me :(

same ..please help me if you find solution

Hey guys,
npm install -g expo-cli --force
Thanks for solution, it works for me but if it doesn't work for anyone in here, try to type expo start instead of yarn or npm start. Also this worked for me too.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings