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

Error: Cannot find module 'qrCode-terminal' in my project #42

Open
glaucioripol opened this issue Nov 28, 2020 · 3 comments
Open

Error: Cannot find module 'qrCode-terminal' in my project #42

glaucioripol opened this issue Nov 28, 2020 · 3 comments

Comments

@glaucioripol
Copy link

glaucioripol commented Nov 28, 2020

my code sample

const qrCode = require('qrCode-terminal')

module.exports.showQrCodeOnTerminal = qr => qrCode.generate(qr, { small: true })

Exception:

glaucio@ ~/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho (main) $ npm start

robo@1.0.0 start /home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho
node src/index.js

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

Error: Cannot find module 'qrCode-terminal'
Require stack:

  • /home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/services/showQrCodeOnTerminal.js
  • /home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/services/index.js
  • /home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/services/showQrCodeOnTerminal.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/services/showQrCodeOnTerminal.js',
    '/home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/services/index.js',
    '/home/glaucio/workspace/glaucio/redirecionarMsgsWhatsAppRodolpho/src/index.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! robo@1.0.0 start: node src/index.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the robo@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.****
@cinderblock
Copy link

  1. You should post your code when asking for help. Just seeing npm start is usually not enough.
  2. Please use code blocks for code/log output. It is much easier to read. Use triple backticks (```) to make it look like this:
    console.log('Hello, World.");
  3. require and import are case-sensitive. You have 'qrCode-terminal'. You need 'qrcode-terminal'.

@glaucioripol
Copy link
Author

module where I declared the use of lib

const qrCode = require('qrCode-terminal')

module.exports.showQrCodeOnTerminal = qr => qrCode.generate(qr, { small: true })

@cinderblock
Copy link

Thank you for posting the code example. Thank you extra for using code blocks.

If you want to be extra awesome, edit your initial comment to use code blocks.

Please read my third point again to see the solution you need :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants