I am getting this error while running gulp, I already have babel-register installed.
[18:51:21] Requiring external module babel-register
module.js:327
throw err;
^
Error: Cannot find module './_baseIsRegExp'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (D:\ndbsite\src\NdbSite.UI\node_modules\babel-plugin-transform-class-properties\node_modules\babel-helper-function-name\node_modules\babel-types\node_modules\lodash\isRegExp.js:1:82)
at Module._compile (module.js:409:26)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (D:\ndbsite\src\NdbSite.UI\node_modules\babel-register\lib\node.js:156:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
seems I am missing some package. Not sure how to find it. Please Help.
The issue I was facing because of old packages referenced inside other Modules were not updated
As suggested by #loganfsmyth in comment. I updated node & npm. Still issue exists since old packages were not updated inside the hierarchy.
Resolution is to delete old folders using rimraf and then npm install with new node & npm :
npm install rimraf -g
rimraf node_modules
npm install
Related
D:\Alief\Kelas-12\KK4-B\react_native_crud>react-native start error
Below is the error what i am getting after running the above command,
Cannot find module 'metro-resolver'. Run CLI with --verbose flag for
more details. Error: Cannot find module 'metro-resolver' 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>
(D:\Alief\Kelas-12\KK4-B\react_native_crud\node_modules\metro-
core\src\errors\PackageResolutionError.js:12:18) 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)emphasized text
Have you tried installing the dependency metro-resolver?
Open cmd in your react-native project's folder and run command
npm i metro-resolver & npm install.
if using yarn,
yarn add metro-resolver
&
yarn install
npm i metro-resolver will install "metro-resolver" and npm install will install all the required dependencies mentioned in your package.json .
You can run npm install only but in-case metro-resolver is not on your package.json so you'll have to download it by name npm install metro-resolver otherwise npm install is enough .
previously node was working properly.
After that as i wanted to install express & socket.io.
it asked for node version update.
i tried to update node version & i believe i forgot some command to run in updation process.
now it's giving following error on any npm command. even if i type only npm, that'll give error.
m#m-Lenovo-ideapad-320-15IKB:/var/www/html/chat$ npm -v
nternal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'semver'
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:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789: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)
Finally it got solved, i think following process worked.
deleted npm module from usr folder
I removed npm module
cleared the cache
installed npm
& it worked
The mistake i was doing was not clearing the cache
I tried upgrading react-native in a seperate branch and it caused some issues, so i reset everything and abandoned the branch. Currently on version: "react-native": "0.59.9",
Now when I try and run any command with react-native including react-native info I get the following error:
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '../../tools/PackageManager'
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> (/home/_name_/solo/node_modules/#react-native-community/cli/build/commands/install/install.js:10:46)
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)
I tried several node versions using NVM.
Currently on 10.16.0 of node.
react-native appears to be working correctly when I create a new project and run commands
I have tried blowing away node_modules and package-json, locking down all versions of libraries, still no luck.
Seems it coudn't find the npm. Can you check the npm it is working in the same workspace and try to reinstall the react native commands with the same npm.
npm install -g react-native-cli
I am using MacOS High Sierra(10.13.5).
When I run npm command, e.g. npm -v, I constantly get this error:
module.js:471
throw err;
^
Error: Cannot find module 'buffer-shims'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:36:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
I tried the following solution, which I found after googling:
rm -r node_modules; rm package-lock.json; npm install
I succeeded at removing the node_modules folder, but I can't find a package-lock.json file and I still get the same error.
How do I resolve the npm error I am encountering?
No idea if this is still necessary, but for future reference: I encountered the same problem and was able to fix it.
What I did was just reinstall nodejs (11.1.0 at the time of writing) and then all npm commands were working again. I think for some odd reason the nodejs/npm install got fubar and kept on throwing the aforementioned errors.
I ran the command npm install --save loadash
Then I tried to uninstalling it with the command npm uninstall --save loadash
but after that when I tried to run the app using ionic serve the following error is thrown. What to do?
Cannot find module 'lodash/assign'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/admin/HybridApps/ayrll/node_modules/xmlbuilder/lib/index.js:5:12)
at Object.<anonymous> (/Users/admin/HybridApps/ayrll/node_modules/xmlbuilder/lib/index.js:14:4)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
Cannot find module 'lodash/assign'
Means it is looking for lodash assign somewhere in your code base.
There is one major issue with this command npm uninstall --save loadash , what is "loadash"? it should be "lodash", but besides that if lodash has been removed from your package.json it wont remove any references that are in the code based.
You should do a full search for assign in your code. If there is no results then i would recommend completing a fresh ionic serve to rebuild the project.