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 in Node-js by kartik
• 30,930 points
296 views

1 answer to this question.

0 votes

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 by Niroj
• 67,020 points

Related Questions In Node-js

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 in Node-js by Niroj
• 67,020 points
290 views
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 4 days ago in Node-js by anonymous
• 140 points
108 views
0 votes
1 answer

Error:npm throws error without sudo

Hello @kartik, This looks like a permissions issue ...READ MORE

answered Jul 8 in Node-js by Niroj
• 67,020 points
194 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 in Laravel by Niroj
• 67,020 points
2,797 views
0 votes
1 answer

What is redirection in Laravel?

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

answered Mar 18 in Laravel by Niroj
• 67,020 points
333 views
0 votes
1 answer

How to install Laravel via composer?

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

answered Mar 23 in Laravel by Niroj
• 67,020 points
228 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 in Laravel by Niroj
• 67,020 points
3,463 views
0 votes
1 answer

Error:sudo: npm: command not found

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

answered Jul 15 in Node-js by Niroj
• 67,020 points
2,842 views
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 in Node-js by Niroj
• 67,020 points
372 views