Expo React Native Cannot find module './assets/empty-module.js' - react-native

I create new project with
expo init AwesomeProject
after run npm start. But I have error
Error: Cannot find module './assets/empty-module.js'
at Function.Module._resolveFilename (module.js:339:15)
at Function.require.resolve (internal/module.js:23:19)
at Object.<anonymous> (/PATH/TO/MY/PROJECT/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js:20:29)
at Module._compile (module.js:413:34)
at loader (/PATH/TO/MY/PROJECT\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/PATH/TO/MY/PROJECT\node_modules\babel-register\lib\node.js:154:7)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)

Go to root project folder and run:
rm -rf node_modules && yarn
Work for me.

Related

Problem when using generator-rn-toolbox to apply icon

I use generator-rn-toolbox to set icon and splash screen for my react-native app as instructions
- install generator npm install -g yo generator-rn-toolbox
- install brew brew install imagemagick
- generate icons yo rn-toolbox:assets --icon ~/Desktop/logo.png
Then I encountered an error as below
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'universal-analytics'
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> (/usr/local/lib/node_modules/generator-rn-toolbox/analytics.js:1:74)
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)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-rn-toolbox/generators/assets/index.js:5:19)
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)
I tried to run npm install universal-analytics but it doesn't work. Do you have any solutions?
I solved by
npm remove -g yo generator-rn-toolbox
npm install -g yo generator-rn-toolbox
We look forward to helping you

Cannot find module 'cli-cursor' vue-cli

i installed vue-cli
but when i run
vue create -f name
i get this error :
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'cli-cursor'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\mrkinix\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\inquirer\lib\prompts\list.js:9:17) at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) 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)
PS D:\New folder>
Install cli-cursor globally using npm or yarn:
$ npm install -g cli-cursor
or,
$ yarn global add cli-cursor

Why can I not start the Vue UI after installing the Vue CLI?

Using the following:
node 8.11.2
npm 6.3.0
I then try to install the Vue CLI (#vue/cli#3.0.0):
npm i -g #vue/cli
but when I run the following command:
vue ui
I get the following error:
Error: Cannot find module 'core-js/modules/es7.object.entries'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Apps\caches\npm\node_modules\#vue\cli\node_modules\apollo-upload-server\lib\mi
ddleware.js:14:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
It turned out I had to install the core-js package explicitly.
npm i -g core-js
Not sure why this wasn't installed as a dependency though.
The issue has been reported HERE and has been fixed in v3.0.1.

npm commands are throwing error

I have installed nodejs and also have "package.json" in my application.
But every npm command is throwing following error in console:
module.js:540
throw err;
^
Error: Cannot find module 'internal/util/types'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at evalmachine.<anonymous>:31:26
at Object.<anonymous> (C:\Users\SattikaA\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\node_modules\graceful-fs\fs.js:11:1)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
I've tried to remove and reinstall latest nodejs version; still problem remains the same.
not load from node_module folder, it need begin with './', '../' or '/'。more detail on https://nodejs.org/api/modules.html#modules_core_modules

Cannot find module './packager/babelRegisterOnly'

This error probably has to do with package manager and happens when I run react-native start
Full Error:
module.js:340
throw err;
^
Error: Cannot find module './packager/babelRegisterOnly'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Users/amirsharif/mobile-rappad/node_modules/react-native/cli.js:11:1)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
I uninstalled react native with NPM then ran npm install react-native again and it worked. I cleared out everything in the node_modules folder.
Uninstall react-native fitst, then re-install it. It's work to me.