Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm internal/modules/cjs/loader.js:883 throw err; ^ Error: Cannot find module 'code-point-at' Require stack: - C:\Users\(File Name)\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\node_modules\string-width\index.js #38317

Closed
HamzaZaidiX opened this issue Apr 20, 2021 · 26 comments
Labels
wrong repo Issues that should be opened in another repository.

Comments

@HamzaZaidiX
Copy link

HamzaZaidiX commented Apr 20, 2021

Note from Node.js team: This issue appears to be popular in Google search results. Unfortunately the error "Cannot find module *** at" is pretty generic. Usual causes are the package missing in your node_modules folder (if you forgot to npm install it for example) and maybe also your package.json file.

Please open bugs / issues at https://github.com/nodejs/help/issues.


Hello Everyone!
I am Having an Error in Node Js Please! Take a look at my problem I have tried all the commands but no change Please! see my error and tell me where I am wrong I have tried Everything Please! Tell me how to solve this Problem if u know!
The error (down below) is coming in when I type npm or npx .

C:\Users\Hamza Zaidi>npm
internal/modules/cjs/loader.js:883
  throw err;
   ^
Error: Cannot find module 'code-point-at'
Require stack:
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\node_modules\string-width\index.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\wide-truncate.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\render-template.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\plumbing.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\index.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\npmlog\log.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:952:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:88:18)←[39m
    at Object.<anonymous> (C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\←[4mnpm←[24m\node_modules\←[4mgauge←[24m\node_modules\←[4mstring-width←[24m\index.js:3:19)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:952:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\node_modules\\string-width\\index.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\wide-truncate.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\render-template.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\plumbing.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\index.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npmlog\\log.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'←[39m
  ]
}

I have Uninstall the Node js and Reinstall again but no change I have tried The Commands like:
Delete the node_modules
Delete the package-lock .json file
Run npm install
Run npm start
Run This command: rm -rf node_modules package-lock.json && npm install && npm start but this command is also giving error 'rm' is not recognized as an internal or external command, operable program or batch file.

Screenshot (54)

@Ayase-252
Copy link
Member

I think it is a problem with npm rather than Node.js. and it seems has been reported. You can track npm/cli#2850. I'm closing this as wrong repo for now.

Please feel free to reopen the issue, if you have further concerns about it.

@HamzaZaidiX
Copy link
Author

HamzaZaidiX commented Apr 27, 2021


What will do please tell me if you know how to solve this problem!!! 😢 👎

C:\Users\Hamza Zaidi>npm
internal/modules/cjs/loader.js:883
  throw err;
   ^
Error: Cannot find module 'code-point-at'
Require stack:
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\node_modules\string-width\index.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\wide-truncate.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\render-template.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\plumbing.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\index.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\node_modules\npmlog\log.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:952:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:88:18)←[39m
    at Object.<anonymous> (C:\Users\Hamza Zaidi\AppData\Roaming\npm\node_modules\←[4mnpm←[24m\node_modules\←[4mgauge←[24m\node_modules\←[4mstring-width←[24m\index.js:3:19)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:952:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\node_modules\\string-width\\index.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\wide-truncate.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\render-template.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\plumbing.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\gauge\\index.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npmlog\\log.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js'←[39m,
    ←[32m'C:\\Users\\Hamza Zaidi\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'←[39m
  ]
}

I have Uninstall the Node js and Reinstall again but no change I have tried The Commands like:
Delete the node_modules
Delete the package-lock .json file
Run npm install
Run npm start
Run This command: rm -rf node_modules package-lock.json && npm install && npm start but this command is also giving error 'rm' is not recognized as an internal or external command, operable program or batch file.

Screenshot (54)

@armelangton
Copy link

I am having same issue

@bl-ue
Copy link
Contributor

bl-ue commented Jun 8, 2021

Hey @hamzajaffar and @armelangton! I'm sorry you're having trouble. If you look at the issue that @Ayase-252 pointed out (npm/cli#2850), you can see that, indeed, @TheSpeddyEthanYT is experiencing the same problem. Since this is likely a problem with npm and not Node.js, please comment over there, and they will probably help :)

@h4nnahalt
Copy link

I'm having the same problem

@barhouum7
Copy link

Facing the same issue. Output of node --trace-deprecation ... -->

internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'E:\City I-vast\cityivast-website\...'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Anyone knows how to solve this please?

@techpawan
Copy link

techpawan commented Aug 26, 2021

1.Uninstall the NPM
2.Re-Install
3.Restart(Optional)
3. run the command again
@barhouum7

@simonhauser28
Copy link

Facing the same issue. Output of node --trace-deprecation ... -->

internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'E:\City I-vast\cityivast-website\...'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Anyone knows how to solve this please?

I have the same problem. Were you able to solve it?
If yes, please let me know the solution.

Thanks Simon
Duplicate of #

@barhouum7
Copy link

@simonhauser28 the solution depends on your main problem... can you please show us the error that you've faced, without doing this command: node --trace-deprecation ...
you may need to downgrade to a specific node version, okay.

@simonhauser28
Copy link

Thanks for your response
the error is the same, I attached my package.json file
node error
package

@barhouum7
Copy link

Are you able to run your app locally without errors? using this: npm run dev

@simonhauser28
Copy link

I get some errors

error

@barhouum7
Copy link

@simonhauser28
So your real problem is this error: Error: Invalid JSON RPC response: "user project is inactive\n"

  • You may need to upgrade the web3 version to the latest one.
    or
  • You may miss adding your IFURA Node key to a secret file.

Now you have to search for it, may these links will help you:
-> #11865 (comment)
-> https://ethereum.stackexchange.com/a/25300
-> web3/web3.js#1470
-> https://ethereum.stackexchange.com/questions/23473/web3js-error-invalid-json-rpc-response-when-creating-new-contract?rq=1

@FabianGFX
Copy link

This similar problem has happened to me and I might have found a fix for a handful of people:

For me, this occurred when I deleted a file called 'hello' under a folder called 'commands'
I just simply created an empty file called 'hello' inside the folder 'commands' and everything when back to normal. Not sure why NPM isn't deleting any links to deleted files.

If you recently deleted a file, try adding an empty file and renaming it like the original or what the error is telling you is missing, inside the folder it's requesting.

For example > @simonhauser28 < Has an error: Cannot find module 'C:\User\hauser\Desktop\CampaignCoin\compile.js'

Adding a file named 'compile.js' under 'CampaignCoin' may be a temporary fix.

Let me know if it helped in anyway

@sakshi-co1
Copy link

Thanks for your response
the error is the same, I attached my package.json file
node error
package

try changing your file directory. The same happened with me but now its resolved after this

@joinwen
Copy link

joinwen commented Oct 8, 2021

I don't know how to solve this, but just rename my project to lower case or remove blank, it seems work!

@Heka666
Copy link

Heka666 commented Feb 8, 2022

npm ERR! Missing script: "dev"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

npm ERR! A complete log of this run can be found in:
npm ERR! /var/root/.npm/_logs/2022-02-08T22_25_47_949Z-debug-0.log

@kant146
Copy link

kant146 commented Feb 23, 2022

Screenshot 2022-02-24 052141

@impolska742
Copy link

Capture

@ash737
Copy link

ash737 commented May 24, 2022

  • Remove Node.js and install again from windows setting.
  • Uninstall ionic npm uninstall -g ionic
  • Reinstall ionic npm install -g ionic@4.0.

This is work for me

@khaoula17
Copy link

had the same problem...
its node.js version issue
i downgrade it to v14.17.6 its the version that worked for me...try what node.js version work best for you
delete the npm cache file by runing
npm cache clean
uninstall the npm
and its working
hope to work for you too

@DevRelMalima
Copy link

PS C:\WINDOWS\system32> npm install -g -production windows-build-tools
npm WARN config production Use --omit=dev instead.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
npm ERR! code 1
npm ERR! path C:\Users\MALIMA\AppData\Roaming\npm\node_modules\windows-build-tools
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./dist/index.js
Downloading vs_BuildTools.exe
npm ERR! [> ] 0.0% (0 B/s)
npm ERR! Downloaded vs_BuildTools.exe. Saved to C:\Users\MALIMA.windows-build-tools\vs_BuildTools.exe.
npm ERR!
npm ERR! Starting installation...
npm ERR! Downloading installers failed. Error: TypeError: 'process.env' only accepts a configurable, writable, and enumerable data descriptor
npm ERR! at Function.defineProperty ()
npm ERR! at Object.removePath (C:\Users\MALIMA\AppData\Roaming\npm\node_modules\windows-build-tools\dist\utils\remove-path.js:11:12)
npm ERR! at Object.install (C:\Users\MALIMA\AppData\Roaming\npm\node_modules\windows-build-tools\dist\install\index.js:29:19)
npm ERR! at C:\Users\MALIMA\AppData\Roaming\npm\node_modules\windows-build-tools\dist\start.js:17:19
npm ERR! at Object.download (C:\Users\MALIMA\AppData\Roaming\npm\node_modules\windows-build-tools\dist\download.js:35:5)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! at async Object.aquireInstallers (C:\Users\MALIMA\AppData\Roaming\npm\node_modules\windows-build-tools\dist\aquire-installers.js:32:13) {
npm ERR! code: 'ERR_INVALID_OBJECT_DEFINE_PROPERTY'
npm ERR! }
npm ERR! windows-build-tools will now exit.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MALIMA\AppData\Local\npm-cache_logs\2022-06-19T06_47_47_455Z-debug-0.log

Hi i keep having this error for like days please what can i do?

@alexandremendes381
Copy link

1- delete node_modules
2- delete package-lock.json

npm uninstall node-sass

npm cache clear --force

npm update

npm install --force

npm install --save-dev sass --force

npm install --save-dev node-sass --force

npm install @types/jquery@2.0.42 --save-dev --force

npm install lite-server@2.3.0 --save-dev --force

npm install concurrently@3.4.0 --save-dev --force

npm install react-scripts --save --force

npm uninstall -g ionic --force

npm install -g ionic@4.0. --force

@neha06-git
Copy link

I am facing the same issue , Anyone can help with this
Dell@DESKTOP-CM4NRE2 MINGW64 /d/Assignments/MVC-Framework/contactmanagement-app/backend (main)
$ node run dev
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module 'D:\Assignments\MVC-Framework\contactmanagement-app\backend\run'

Dell@DESKTOP-CM4NRE2 MINGW64 /d/Assignments/MVC-Framework/contactmanagement-app/backend (main)
$ node server.js
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module './routes/usertRoutes'
Require stack:

  • D:\Assignments\MVC-Framework\contactmanagement-app\backend\server.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (D:\Assignments\MVC-Framework\contactmanagement-app\backend\server.js:14:23)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'D:\Assignments\MVC-Framework\contactmanagement-app\backend\server.js'
    ]
    }

@Arisha-Developer
Copy link

I am facing this problem again and again. Can anyone explain to me why am I facing this problem?

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

Node.js v19.3.0

@bnoordhuis
Copy link
Member

I'm going to lock this issue. It seems to be one of those issues that shows up high in search engine rankings but this bug tracker is NOT the right place to report such errors.

@nodejs nodejs locked as off-topic and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests