module.js:471 throw err: cannot find module - node.js

I am using 64bit Windows 7 Ultimate and I want to use my project with Gulp when I run Gulp in the console the below error occurred.
module.js:471
throw err;
^
Error: Cannot find module 'C:\Users\Tiger\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js'
So I don't want use gulp from above problem. So what I do now?

LOn Linux CentOS:
rm -rf /usr/lib/node_module
yum reinstall npm
do not update npm
On windows quite the same. Check out where are the libs/modules and delete them.

Try copying ionic folder from
C:\Users\username\AppData\Roaming\npm\node_modules
to the error location.
Some times even after installing packages from package.json, ionic folder doesn't get created and causes Module.js 471 error.
This solved my problem.

I had the same issue. Actually this means gulp is corrupted in your computer. Go to task manager and quit the nodeJS service running and then try to reinstall Gulp.

Related

What can I do to solve the npm "Cannot find module 'util-deprecate'" error?

While install a module using NPM, this error showed up.
**
Error: Cannot find module 'util-deprecate'
**
I uninstalled and reinstalled the entire Node.js but every attempt to install modules using NPM was futile and every time same error keeps popping up.
Windows 10 with latest Node.js 12.18.3
Ok, I resolved the issue myself.
While updating the NPM using command line, the update crashed and many files within the C:\Users\UserName\AppData\Roaming\npm\node_modules\npm\node_modules were deleted.
Solution would be to copy the missing modules from Node Modules within npm of Node Js directory in Program Files (Windows). It will work for sure.
Thank you.
Install NVM and use the correct version of Node.JS
https://github.com/nvm-sh/nvm
~ nvm usw 11
Solved the OP's error for me.

Appium is not installing

I installed appium on windows through command. But when I tried to run, it shows error.
C:\Users\Admin>appium
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module 'C:\Users\Admin\AppData\Roaming\npm\node_modules\appium\build\lib\main.js'
Error after installing appium
Image of console
Installation is failing because files it needs to create already exist. You need to pass the --force flag when installing to overwrite these files:
npm install -g --force appium
Update your node.js by downloading the installer package of node js

Npm not installed

I recently downloaded node.js from nodejs.org and installed it correctly on windows, from gitbash I ran node -v,it gave me a version number,but when I ran npm -v, I get bunch of error message like these;
Internal/module/cjs/loader.js:330
Throw err;
Error: cannot find module 'C:\Program Files\nodejs\node_modules\npm\node_modules\nom-registry-fetch\node_modules\fighy-pudding\index.js'.
Please verify that the package.json has a valid "main" entry
And other bunch of errors...
How do I fix these please
Well, i tried alot of replies, still ended up the same.
I reinstalled windows and installed the same nodejs.exe i downloaded and npm was installed...lol

can't install module 'merge-descriptors'

I'm new to node.js.
I'm using WebStorm. I work on Windows.
I configured my app to run on node.js and when I try to run it I get this error:"Cannot find module 'merge-descriptors'".
I followed these post trying to solve it: How do I resolve "Cannot find module" error using Node.js?,
module.js:338 throw err in node.js
I ran "del /s /q node_modules" (parallel to "rm -rf node_modules").
Now I'm trying to run "npm install -g" and I'm getting this error:
See screen shot below
I've tried to understand it and to look for information about it in the net to no avail.
Any help will be profoundly appreciated!
I had similar issue installing the module, I tried npm install or npm update but my network would timeout. However what I did is very simple:
npm install merge-descriptors --save
When installing the dependencies for a package you should be using npm install and not using the -g flag.
The g flag, or global is used when installing a package globally, which places them in a direct location that is not accessible by the project.
See https://docs.npmjs.com/files/folders
The specific error you're seeing is that the logged in user doesn't have permission to write to the install directory. This can be overcome with sudo command, ex., sudo npm install. But as others have indicated, if you have to do this then something about your app's configuration could be wrong.

libsass bindings not found when running gulp dist

I'm trying to use a gulp project on my Linux machine. The readme for the project tells me to first run sudo npm install -g gulp bower, then in the project directory run sudo npm install and then bower install. Everything up to this point works just fine for me. However, after that I try to run gulp dist and get this error:
Error: `libsass` bindings not found in /[PROJECT DIRECTORY]/trunk/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node. Try reinstalling `node-sass`?
Googling that error produced this: libsass bindings not found when using node-sass in nodejs, which I tried, but that didn't fix anything. When I looked through that directory that gulp said it couldn't find the difference was the linux-x64-14, mine said linux-x64-11, so I'm assuming I have the wrong version? Just for fun I decided to try changing the name of that folder to what it wanted, and I got a different error:
Error: Module did not self-register.
The really strange thing about all this is that when I tried getting this project working on my Windows machine I didn't have any of these issues, it just worked. I have no idea what I'm doing wrong, any ideas?
I've solved this by updating GCC from 4.4.x to 4.7.x.
Because GCC 4.4.x cannot compile node-sass of current version.
It worked for me using below commands. Try it
npm rebuild node-sass
rm -rf node_modules
npm i
This error usually shows up for us when we update our node or io.js version.
I would recommend deleting your node_modules folder and running npm install again.
If that doesn't work it is probably worth deleting your npm cache. There are a number of ways to do it including just a simple npm cache clean
I would also recommend deleting your ~/.npm folder as well just to be sure.
If this doesn't work let me know and we can start debugging your actual Node version and your package.json

Resources