-3
    >npm -v
node:internal/modules/cjs/loader:936
  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 (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.4.0
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
←[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)←[39m
←[90m    at node:internal/main/run_main_module:17:47←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: []
}

Node.js v17.4.0

I installed node on my pc, but it's showing this error, please tell me how to resolve this in windows? I installed node on my pc, but it's showing this error, please tell me how to resolve this in windows? I installed node on my pc, but it's showing this error, please tell me how to resolve this in windows? I installed node on my pc, but it's showing this error, please tell me how to resolve this in windows?

msanford
  • 11,803
  • 11
  • 66
  • 93
  • 1
    Does this answer your question? [NPM: npm-cli.js not found when running npm](https://stackoverflow.com/questions/24721903/npm-npm-cli-js-not-found-when-running-npm) – Filburt Jan 25 '22 at 16:35
  • 1
    Don't bypass our content filters by copy/pasting the same phrase over and over - it's extremely rude to bypass them just because you don't feel like adding more details (as per its request), as those filters are there **for a reason** - your question is severly lacking the context necessary to provide you with concrete advice on how to resolve your issue & I'm voting to close as such. Please familiarize yourself with [ask]. – esqew Jan 25 '22 at 16:35
  • ok sure , sorry for that ,I am facing since evening , tried all sols.also – MaNav MaLhoTra Jan 25 '22 at 16:43

3 Answers3

1

In my case, my partner folder contains the & character in the name that was causing the issue. File hierarchy R&D>remix>blog, changed it to RnD>remix>blog, and it started working fine. For some reason node is unable to find the modules because of those special characters.

Error:

code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
venky royal
  • 1,860
  • 2
  • 11
  • 19
0
  1. Open "C:\Program Files\nodejs\node_modules\npm\bin"
  2. Right click npm.cmd and click edit
  3. change the following lines

SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" to SET "NPM_CLI_JS=%~dp0\npm-cli.js"

and

SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" to SET "NPM_PREFIX_NPM_CLI_JS=%%F\npm-cli.js"

-2

Try uninstall NodeJS and install again

Try to use the stable version: https://nodejs.org/dist/v16.13.2/node-v16.13.2-x64.msi