Hi.
I have next problem, when I am trying to do something with npm (install, config, etc.) I got the message:
"Error: Cannot find module 'dezalgo'". This happened every time.
node -v:6.10.3
npm -v: "Error: Cannot find module 'dezalgo'".
Had someone the same? Please help.
Thanks.
which version of npm are you using?
npm -v
will tell you.
cc @zkat
@vaibhav93 What platform are you on? If your are on Mac or Windows can you try using one of the Node.js installers to get a clean version of node
and npm
?
Otherwise, npm
has install / uninstall instructions here: https://www.npmjs.com/package/npm
This is almost deffo a hosed npm install. That can happen for a lot of reasons :\
@mcollina I wrote that I can麓t check the version, I got the error.
@Fishrock123 I'm working on Windows. I tried to reinstall node.js, after the installation everything works but after few installation, I got the same error.
@Vladyslav93 as you can reinstall node to have a working environment, can you note down the npm version _before_ it shows the problem, and then the steps needed to reproduce?
@mcollina Yeap. Sorry)
npm -v: 5.0.3
@mcollina After this line, everything works for now. But I did not understand what the problem with version 5?
Looks like your system failed to compile a Native C++ module.
What version of VS Studio build tools do you have? (If any?)
@Fishrock123 I tried 2010,2012,2013,2015,2017. The same with everyone.
Put into cmd.exe line:
SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
npm 5.6 throws this error, had to downgrade to 5.5.1
happened after i installed jquery package
@mwilde345 i have also come across that situation. The way i solved was uninstalling the jquery and installing the packages that i needed. And installed back the jquery package in the end.
Thank you @mcollina ! you saved my day :)
after this npm i npm@4 -g
everything worked fine for me.
@samee-ch no worries, happy to help!
Thanks for these suggestions
sudo npm install npm@4 -g
sudo npm install -g [email protected]
But downgrading npm fails with the same message:
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: Cannot find module 'dezalgo'
4 verbose stack at Function.Module._resolveFilename (module.js:470:15)
4 verbose stack at Function.Module._load (module.js:418:25)
4 verbose stack at Module.require (module.js:498:17)
4 verbose stack at require (internal/module.js:20:19)
4 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/correct-mkdir.js:2:15)
4 verbose stack at Module._compile (module.js:571:32)
4 verbose stack at Object.Module._extensions..js (module.js:580:10)
4 verbose stack at Module.load (module.js:488:32)
4 verbose stack at tryModuleLoad (module.js:447:12)
4 verbose stack at Function.Module._load (module.js:439:3)
4 verbose stack at Module.require (module.js:498:17)
4 verbose stack at require (internal/module.js:20:19)
4 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/locker.js:8:20)
4 verbose stack at Module._compile (module.js:571:32)
4 verbose stack at Object.Module._extensions..js (module.js:580:10)
4 verbose stack at Module.load (module.js:488:32)
5 verbose cwd /home/laci/Dev/inventorything/inventory.angular
6 verbose Linux 4.4.0-112-generic
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
8 verbose node v7.4.0
9 verbose npm v5.6.0
10 error code MODULE_NOT_FOUND
11 error Cannot find module 'dezalgo'
12 verbose exit [ 1, true ]
@zaszlo could you please try to remove package-lock.json + node-modules and run npm install. Hopefully, it will resolve this issue.
I purged nodejs with force :) and then reinstalled with nvm, now I don't get errors anymore :-D
I have the same problem
I would recommend to open an issue to https://github.com/npm/npm with a full example to reproduce. It's not a node bug anyway.
I had the same problem, and it turned out the anti-malware program was causing it. Deactivate it and see if it works any better
try to instal the latest npm with npm i -g npm@latest
, remove the package-lock.json, then reinstall the deps.
This sometimes happens if a package has a _dependency_ on an older version of npm
.
if you are on npm version (global) of 5.6.0, there may be an issue.
Install npm version (global) 5.2.0, delete your node modules then reinstall and it should work
Thanks @jackhardy1 its worked for me!
For the solution was to:
rm -rf node_modules
npm i
On npm
npm -v
5.6.0
Most helpful comment
npm 5.6 throws this error, had to downgrade to 5.5.1