novu icon indicating copy to clipboard operation
novu copied to clipboard

🐛Cannot find module react-scanner.config.js

Open sschwenker opened this issue 3 months ago • 8 comments

📜 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/[email protected] prepare:audit C:\Development\git\novu\libs\design-system │ > pnpm audit-components │ > @novu/[email protected] 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\[email protected]\node_modules\react-scanner\src\index.js │ - C:\Development\git\novu\node_modules.pnpm\[email protected]\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\[email protected]\node_modules\react-scanner\src\index.js:14:20 │ at o.parse (C:\Development\git\novu\node_modules.pnpm\[email protected]\node_modules\sade\lib\index.js:1:3402) │ at Object. (C:\Development\git\novu\node_modules.pnpm\[email protected]\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\[email protected]\node_modules\react-scanner\src\index.js', │ 'C:\Development\git\novu\node_modules\.pnpm\[email protected]\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?

  • [X] I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

sschwenker avatar May 03 '24 17:05 sschwenker

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

itsmemittal avatar May 05 '24 10:05 itsmemittal

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.

ayo6706 avatar May 05 '24 19:05 ayo6706

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"

chaunm182 avatar May 08 '24 07:05 chaunm182

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.

ayo6706 avatar May 08 '24 08:05 ayo6706

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/[email protected] build /mnt/c/Development/git/novu/enterprise/packages/libs/dal

node ./check-ee.mjs

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

@novu/[email protected] 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`

sschwenker avatar May 09 '24 19:05 sschwenker

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.

ayo6706 avatar May 09 '24 20:05 ayo6706

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

sschwenker avatar May 10 '24 20:05 sschwenker