Error: Cannot find module 'source-map-support' - react-native

Out of nowhere, my working react native app gave me this error when I opened it today. I tried npm install , yarn and cleaning the cache but nothing helped. As I said, it came out out of nowhere as everything used to work fine before that. What could be the reason for this and how can I solve it?
> expo start
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'source-map-support'
Require stack:
- C:\Users\Angel\AppData\Roaming\npm\node_modules\expo-cli\node_modules\xdl\build\index.js
- C:\Users\Angel\AppData\Roaming\npm\node_modules\expo-cli\build\exp.js
- C:\Users\Angel\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Angel\AppData\Roaming\npm\node_modules\expo-cli\node_modules\xdl\build\index.js:4:30)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Angel\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\xdl\\build\\index.js',
'C:\\Users\\Angel\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\build\\exp.js',
'C:\\Users\\Angel\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\bin\\expo.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start 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\Angel\AppData\Roaming\npm-cache\_logs\2021-06-06T18_17_52_900Z-debug.log

After lots of hours of struggle at the end I just deleted Expo and then installed it again and it worked.

Related

Broken Vue CLI installation npm

after trying to update vue cli to its latest version using npm update, now everytime I run vue it throws the following error:
vue create
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'strip-ansi'
Require stack:
- /usr/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/lib/logger.js
- /usr/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/index.js
- /usr/lib/node_modules/#vue/cli/bin/vue.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:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/lib/logger.js:2:19)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/lib/logger.js',
'/usr/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/index.js',
'/usr/lib/node_modules/#vue/cli/bin/vue.js'
]
}
Node.js v17.3.0
If I try to uninstall the package, I also get an error:
sudo npm uninstall -g #vue/cli
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/#vue/cli
npm ERR! dest /usr/lib/node_modules/#vue/.cli-kgOlUxFE
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/usr/lib/node_modules/#vue/cli' -> '/usr/lib/node_modules/#vue/.cli-kgOlUxFE'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-17T17_58_23_457Z-debug-0.log
I don't know what to do, I need vue cli working
Thanks in advance
You can try to remove the node_modules folder and install all dependencies again with npm install.

How to solve error “SyntaxError: Unexpected token” and “npm ERR! code ELIFECYCLE”

I receive the following error when I run npm start. Could anyone please help me with this issue. I encounter it only on Windows 10; everything works fine on macOS.
Here is the traceback:
$ npm start
> webpack-boilerplate#1.0.0 start E:\Projects\Upwork_Projects\wellness-osteo\markup
> webpack-dev-server --open --config webpack.dev.js
E:\Projects\Upwork_Projects\wellness-osteo\markup\node_modules\copy-webpack-plugin\node_modules\p-limit\index.js:30
} catch {}
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (E:\Projects\Upwork_Projects\wellness-osteo\markup\node_modules\copy-webpack-plugin\dist\index.js:12:38)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webpack-boilerplate#1.0.0 start: `webpack-dev-server --open --config webpack.dev.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-boilerplate#1.0.0 start 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\krish\AppData\Roaming\npm-cache\_logs\2020-09-08T17_46_12_163Z-debug.log
This is because the catch statement is missing an exception variable
it should have been written as
} catch (e) { }
This has been resolved as of copy-webpack-plugin^#6.3.0
Try upgrading / downgrading to an earlier version to resolve this.
c.f try/catch block in the Javascript MDN documentation

Vue - Error: Cannot find module 'webpack/bin/config-yargs'

I'm new to Vue.js.
I cloned a project from github and i tried to run it by npm run dev.
Unfortunately it gives me this kind of error
> webpack-dev-server --inline --hot --env.dev
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'webpack/bin/config-yargs'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\123\Desktop\python2020\Eduwonka\element-starter\node_modules\webpack-dev-server\bin\webpack-dev-server.js:54:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! element-starter# dev: `webpack-dev-server --inline --hot --env.dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the element-starter# dev 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\123\AppData\Roaming\npm-cache\_logs\2020-04-19T15_05_27_959Z-debug.log
Like i said before, I'm new to Vue and I have no idea where to start look for.
Anyone can please direct me what should i do? What am i doing wrong?
This was the solution npm install --save-dev webpack - I dont know why, but it worked

npm run dev suddenly stopped working - Nuxt js

This is my terminal log, when I try to run npm run dev
cross-env HOST=0.0.0.0 PORT=3000 nuxt
module.js:545
throw err;
^
Error: Cannot find module '..'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/MYUSER/Desktop/PROJECTFOLDER/node_modules/.bin/nuxt:9:19)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! PROJECT#1.0.0 dev: `cross-env
HOST=0.0.0.0 PORT=3000 nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the PROJECT#1.0.0 dev 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! /Users/MYUSER/.npm/_logs/2019-03-14T08_05_59_626Z-debug.log
This happened all of a sudden after 1 week working on another project.
Sorry if my tags are incorrect. Feel free to correct them. Thanks in advance.
1.delete node_modules folder
2 .delete package-lock.json
then
npm install

Getting an error for React Native while Building Android App

I am getting following error while building Android Application. Can anyone explain why it is happening
import type {CommandT} from './commands';
^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Module._compile (E:\React_Project\OneTap\node_modules\pirates\lib\index.js:91:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (E:\React_Project\OneTap\node_modules\pirates\lib\index.js:96:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! OneTap#0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the OneTap#0.0.1 start 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:
Based on this GitHub Issue it looks like this is a problem related to RN 0.56 in Windows. As a workaround I would recommend using version 0.55.4.