novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
35.39k stars 3.92k forks source link

πŸ›Cannot find module react-scanner.config.js #5492

Closed sschwenker closed 1 month ago

sschwenker commented 6 months ago

πŸ“œ Description

When I run the pnpm run setup:project command to setup the project, I get the following error.

βœ”οΈ styled-system/jsx: styled jsx elements for react β”‚ > @novu/design-system@0.24.1 prepare:audit C:\Development\git\novu\libs\design-system β”‚ > pnpm audit-components β”‚ > @novu/design-system@0.24.1 audit-components C:\Development\git\novu\libs\design-system β”‚ > pnpm react-scanner -c './react-scanner.config.js' β”‚ node:internal/modules/cjs/loader:1147 β”‚ throw err; β”‚ ^ β”‚ Error: Cannot find module 'C:\Development\git\novu\libs\design-system\'.\react-scanner.config.js'' β”‚ Require stack: β”‚ - C:\Development\git\novu\node_modules.pnpm\react-scanner@1.1.0\node_modules\react-scanner\src\index.js β”‚ - C:\Development\git\novu\node_modules.pnpm\react-scanner@1.1.0\node_modules\react-scanner\bin\react-scanner β”‚ at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15) β”‚ at Module._load (node:internal/modules/cjs/loader:985:27) β”‚ at Module.require (node:internal/modules/cjs/loader:1235:19) β”‚ at require (node:internal/modules/helpers:176:18) β”‚ at C:\Development\git\novu\node_modules.pnpm\react-scanner@1.1.0\node_modules\react-scanner\src\index.js:14:20 β”‚ at o.parse (C:\Development\git\novu\node_modules.pnpm\sade@1.8.1\node_modules\sade\lib\index.js:1:3402) β”‚ at Object. (C:\Development\git\novu\node_modules.pnpm\react-scanner@1.1.0\node_modules\react-scanner\src\index.js:17:4)
β”‚ at Module._compile (node:internal/modules/cjs/loader:1376:14) β”‚ at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) β”‚ at Module.load (node:internal/modules/cjs/loader:1207:32) { β”‚ code: 'MODULE_NOT_FOUND', β”‚ requireStack: [ β”‚ 'C:\Development\git\novu\node_modules\.pnpm\react-scanner@1.1.0\node_modules\react-scanner\src\index.js', β”‚ 'C:\Development\git\novu\node_modules\.pnpm\react-scanner@1.1.0\node_modules\react-scanner\bin\react-scanner' β”‚ ] β”‚ } β”‚ Node.js v20.11.1 β”‚  ELIFECYCLE  Command failed with exit code 1. β”‚  ELIFECYCLE  Command failed with exit code 1. └─ Failed in 8.9s at C:\Development\git\novu\libs\design-system  ELIFECYCLE  Command failed with exit code 1.

πŸ‘Ÿ Reproduction steps

Check out the codebase and run pnpm run setup:project

πŸ‘ Expected behavior

It should install the projects required dependencies.

πŸ‘Ž Actual Behavior with Screenshots

It's throwing the error above.

Novu version

the current next branch

npm version

No response

node version

No response

πŸ“ƒ Provide any additional context for the Bug.

No response

πŸ‘€ Have you spent some time to check if this bug has been raised before?

🏒 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

linear[bot] commented 6 months ago

NV-3715 πŸ›Cannot find module react-scanner.config.js

itsmemittal commented 6 months ago

I tried clone fresh repo but i am not getting any such error can you try with fresh clone ?

ayo6706 commented 6 months ago

I had the same issue, and I think it was because my internet went off during the setup, but I am not certain about it, and I was also using Windows. I then decided to use Ubuntu WSL with Windows, and it works now.

chaunm182 commented 6 months ago

Use linux environment to resolve problem If using Windows, you can remove the parentheses for react-scanner.config.js in libs\design-system\package.json "audit-components": "pnpm react-scanner -c ./react-scanner.config.js"

ayo6706 commented 6 months ago

Use linux environment to resolve problem If using Windows, you can remove the parentheses for react-scanner.config.js in libs\design-system\package.json "audit-components": "pnpm react-scanner -c ./react-scanner.config.js"

I will just advise to switch to a Linux environment or better still make use of Ubuntu WSL on your windows machine because when I faced this issues I had to clone this repo afresh three times and it was resolved when I used a Linux environment.

sschwenker commented 6 months ago

Hey. I re-checked out the code and opened the project using wsl and things got much better, but it still has errors. I'm now seeing this.

`> @novu/ee-dal@0.24.1 build /mnt/c/Development/git/novu/enterprise/packages/libs/dal

node ./check-ee.mjs

node:internal/modules/run_main:129 triggerUncaughtException( ^

@novu/ee-dal@0.24.1 build:esm /mnt/c/Development/git/novu/enterprise/packages/libs/dal cross-env node_modules/.bin/tsc -p tsconfig.build.json error TS18003: No inputs were found in config file '/mnt/c/Development/git/novu/enterprise/packages/libs/dal/tsconfig.build.json'. Specified 'include' paths were '["src/*/"]' and 'exclude' paths were '["./dist"]'.  ELIFECYCLE  Command failed with exit code 2. (Use node --trace-uncaught ... to show where the exception was thrown)

Node.js v20.13.0  ELIFECYCLE  Command failed with exit code 1`

ayo6706 commented 6 months ago

from what i can see here, firstly, you're not using the required node version, v20.8.1, as stated in https://docs.novu.co/community/run-in-local-machine?utm_campaign=github-contrib . Also, make sure you cloned the repo in the WSL environment, which you can also use vscode with the WSL extension to do that easily.

sschwenker commented 6 months ago

I re-cloned the repo into a folder in my home directory in my wsl instance and that worked. Thank you.