Error npm-cli js not found when running npm

0 votes

Usually I can install a library using npm but today when installing yeoman I encountered this errors. Please help to figure out what's root cause.

D:\Works\niroj\ionic\todo>npm install -g yo
    module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'

at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

I looked into the folder:

C:\Program Files\nodejs\node_modules\npm\bin\

but don't see node_modules folder as the error described.

I also try to find npm-cli.js and see it's actually in C:\Program Files\nodejs\node_modules\npm\bin\

Sep 7, 2020 in Node-js by kartik
• 37,520 points
19,341 views

1 answer to this question.

+1 vote

Hello @kartik,

You need to run this in the command line.

SET PATH=C:\Program Files\Nodejs;%PATH%

Hope it helps!!

Thank You!

answered Sep 7, 2020 by Niroj
• 82,840 points
you save me.
Thank for the info..It worked

Related Questions In Node-js

0 votes
1 answer

Error:nvm is not compatible with the npm config "prefix" option:

Hello @kartik, After installing nvm using brew, create ~/.nvm directory: $ ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,840 points
4,809 views
0 votes
1 answer

Error:npm not working after clearing cache

Hello @kartik, Try this: npm cache clean --force OR It ...READ MORE

answered Jul 17, 2020 in Node-js by Niroj
• 82,840 points
6,538 views
0 votes
1 answer
0 votes
2 answers

Error:'TypeError: is not a function' in Node.js

You are exporting module.exports.redir = redir; That means that ...READ MORE

answered Oct 21, 2020 in Node-js by anonymous
• 140 points
17,282 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,012 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,995 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,918 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,696 views
0 votes
1 answer

Error:sudo: npm: command not found

Hello @kartik, I had the same problem; here ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,840 points
12,554 views
0 votes
1 answer

Error:node.js /socket.io/socket.io.js not found

Hello @kartik, Copying socket.io.js to a public folder (something as resources/js/socket.io.js) ...READ MORE

answered Nov 27, 2020 in Node-js by Niroj
• 82,840 points
14,774 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP