Cannot find module './packager/babelRegisterOnly' - react-native

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.

Related

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

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.

How to fix error "Cannot find module" using "expo start"

After upgrading expo-cli to the latest version. I tried starting my app with 'expo start' but I got this error
C:\Users\DevLewa\Desktop\app\AgroSprite>expo
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'split-string'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous>
(C:\Users\DevLewa\AppData\Roaming\npm\node_modules\exp
o-cli\node_modules\braces\lib\utils.js:3:19)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
How do I fix this please?
rollback to version 2.4.3
npm install -g expo-cli#2.4.3
I installed the missing module using
npm install -g split-string
and it worked.
I faced the same problem . I uninstalled expo-cli and nodejs and installed again. It works for me.

johnny-five library is not getting detected by npm

I tried installing Johnny-five library as specified in the website. After installation while running the code i am getting error as below, please help.
While installing Johnny-five package I got a message such as package-lock.json need to be committed, is it creating any issues?
D:\Js-Arduino>node servo.js
module.js:549
throw err;
^
Error: Cannot find module 'johnny-five'
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> (D:\Js-Arduino\servo.js:1:74)
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)
This issue has been resolved.
Moved nodemodules global path to Env variables and Npm started detecting it

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

Yeoman Yo WebApp Generator Issue

I am trying to generate a WebApp using Yeoman Yo Command but I keep getting following error:
pdclap-2stjvs1:ShippingSolutionPlain administrator$ yo webapp
Error: Cannot find module './lib/env'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/index.js:7:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
pdclap-2stjvs1:ShippingSolutionPlain administrator$
Is it an environment variable issue?
Seems like a npm issue. Maybe it didn't copy all files or didn't install a dependency.
Install the latest version of both npm and yo, and retry.