Nodejs: Cannot find module npmlog - node.js

i'm trying to install gulp but it's showing Error:
current version :v4.3.1
Error: Cannot find module 'npmlog'
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 C:\Users\achraf\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:20:13
at Object.<anonymous> (C:\Users\achraf\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:76:3)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)

C:\Users\achraf\AppData\Roaming\npm is the path for global installed modules, so if I have to guess, your global installed npm is not up to date. Try to remove the global installed npm and use the built in version, that comes with the node installer. To remove the global installed npm delete the npm and npm.cmd files in C:\Users\achraf\AppData\Roaming\npm and the folder npm in C:\Users\achraf\AppData\Roaming\npm\node_modules.

Related

Cannot find module , Missing modules #557

After npm install -g #vue/cli#3.0.0-beta.9 ,
I run the command vue create client
I get the following output:
module.js:557
throw err;
^
Error: Cannot find module 'cmd-shim'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(/Users/atalante/.nvm/versions/node/v9.4.0/lib/node_modules/#vue/cli/lib/util/linkBin.js:10:27)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
i tried rm -rf node_modules and npm install
but it doesn't work.
This usually occurs when there is an issue with either your node or npm installations, Try updating node.js and npm to resolve the issue which has worked for me in the past. This might help in updating npm : Update NPM

Trying To install meanjs

Iam Trying To Run meanjs with gulp
But It shows Me That!
$ gulp
module.js:327
throw err;
^
Error: Cannot find module 'vinyl'
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> (/home/bl4ckvghost/TOOLS & PROGRAMS/meanjs/node_modules/gulp-util/index.js:2:9)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
mongodb latest version
npm latest version
bower latest version
gulp latest version
I Want To Know How To Run Meanjs
System: Debian Jessie
Try removing your node modules and installing it again:
rm -rf ./node_modules
npm cache clean
npm install

Cannot find module 'xmlbuilder' when building ionic app

When i executing
ionic start myApp tabs
i am getting below error
Error: Cannot find module 'xmlbuilder'
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> (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:436:4)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
node -v gives v4.4.1
npm -v gives 2.14.20
i have done npm install xmlbuilder
Please install xmlbuilder module to global environment:
npm install -g xmlbuilder

npm version shows Error: Cannot find module 'readable-stream'

I have installed node js on my windows 7 machine, and the version is being shown as v4.1.2 but when I am trying to run npm install or even check npm version it throwing the following error. Can any one help me where is the problem?
C:\Users\nmadasu>npm version
module.js:338
throw err;
^
Error: Cannot find module 'readable-stream'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\nmadasu\AppData\Roaming\npm\node_modules\npm
\node_modules\are-we-there-yet\index.js:2:14)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
After reading SO (Node.js cannot find module 'readable-stream') solutions, I tried npm install gulp -g, even this also giving same error.
C:\Users\nmadasu>npm install gulp -g
module.js:338
throw err;
^
Error: Cannot find module 'readable-stream'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\nmadasu\AppData\Roaming\npm\node_modules\npm
\node_modules\are-we-there-yet\index.js:2:14)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Try:
npm install -g readable-stream
After that:
npm install gulp -g
If you can't do
npm install gulp -g
because you always have : "Cannot find module 'readable-stream'"
then, do :
sudo apt-get install npm
For me on windows the unique process that works is deleting this folders
C:\Users\YOURUSER\AppData\Roaming\npm
C:\Users\YOURUSER\AppData\Roaming\npm-cache
and Reinstall nodejs downloaded from official website
I hopoe this help to others :D

npm doesn't work on an ARM embedded device

I installed Node.js on an embedded device running with a core Linux 3.0.
When I try to execute npm to install some modules, I get the follow issue :
DM-37x# npm
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
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 /usr/local/bin/npm:18:11
at Object.<anonymous> (/usr/local/bin/npm:86:3)
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)
I already tried to reinstall node.js but the bug is still here.
How can I do to fix this problem?
Try installing (or reinstalling) npmlog.
See https://www.npmjs.org/package/npmlog
Make sure you have a package.json file in the top level of your project directory (each project).
Use npm ls
and
npm update
to make sure the npmlog package is included.

Resources