Error: Cannot find module '@babel/parser'
See original GitHub issueDescription
When running npx react-native init myApp
it insalls all dependencies but eventually it will return Error: Cannot find module '@babel/parser'
Version
i dont know. latest i supose
Output of npx react-native info
node:internal/modules/cjs/loader:936 throw err; ^
Error: Cannot find module ‘@babel/parser’ Require stack:
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules\metro\src\Bundler\util.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules\metro\src\Assets.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules\metro\src\Server.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules\metro\src\shared\output\bundle.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli-plugin-metro\build\commands\bundle\buildBundle.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli-plugin-metro\build\commands\bundle\bundle.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli-plugin-metro\build\commands\bundle\index.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli-plugin-metro\build\commands\index.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli-plugin-metro\build\index.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\commands\index.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\index.js
- C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\bin.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (C:\Users\titul\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules\metro\src\Bundler\util.js:12:17) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) { code: ‘MODULE_NOT_FOUND’, requireStack: [ ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\Bundler\util.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\Assets.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\Server.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\shared\output\bundle.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli-plugin-metro\build\commands\bundle\buildBundle.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli-plugin-metro\build\commands\bundle\bundle.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli-plugin-metro\build\commands\bundle\index.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli-plugin-metro\build\commands\index.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli-plugin-metro\build\index.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli\build\commands\index.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli\build\index.js’, ‘C:\Users\titul\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli\build\bin.js’ ] }
Steps to reproduce
run npx react-native init myApp
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Cannot find module '@babel/parser' - Stack Overflow
{ Error: Cannot find module '@babel/parser' at Function.Module._resolveFilename (module.js:548:15) at Function.Module.
Read more >@babel/parser - npm
@babel/parser. A JavaScript parser. See our website @babel/parser for more information or the issues associated with this package. Install.
Read more >How can I solve "Error: Cannot find module '@babel/parser ...
I am new to Vue.js. I tried to create new projet according to tutorials and official Vue/CLI manual. 1) First I ran the...
Read more >Cannot find module '@babel/core' error [Solved] | bobbyhadz
To solve the error "Cannot find module '@babel/core'", make sure to install the @babe/core package by opening your terminal in your project's root...
Read more >parsing error: cannot find module 'next/babel' - You.com
next.js - Parsing error : Cannot find module 'next/babel' - Stack ... ... Create file called .babelrc in your root directory and add...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems node_modules’s problem. I go to the npx directory in the error log(in my Mac is
~/.npm/_npx/7930a8670f922cdb
). And I executeThen it can init project correctly. I hope it’s useful to other who meet this problems.
Closing as the original author is unresponsive + there is a suggested workaround