Closed paradoxloop closed 2 days ago
Agreed that we need to improve the contributing guide, we do have a big PR #1342 that gives written info for everything you would need but it still isn't merged. What you could do for now is check the preview deployment for it and give some feedback to let us know what you think.
Looking at the error you had on pnpm build
, can you share the full logs for the demo
?
Thanks @gabrielmfern
Following the instructions on preview deployment:
> sudo corepack enable
corepack prepare pnpm@latest --activate
Preparing pnpm@latest for immediate activation...
> pnpm install
Scope: all 31 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1164
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1164, reused 1123, downloaded 0, added 1164, done
WARN Failed to create bin at /Users/nico/Documents/projects/react-email-2/apps/demo/node_modules/.bin/email. ENOENT: no such file or directory, open '/Users/nico/Documents/projects/react-email-2/packages/react-email/dist/cli/index.js'
WARN Failed to create bin at /Users/nico/Documents/projects/react-email-2/benchmarks/preview-server/node_modules/.bin/email. ENOENT: no such file or directory, open '/Users/nico/Documents/projects/react-email-2/packages/react-email/dist/cli/index.js'
WARN Failed to create bin at /Users/nico/Documents/projects/react-email-2/apps/web/node_modules/.bin/email. ENOENT: no such file or directory, open '/Users/nico/Documents/projects/react-email-2/packages/react-email/dist/cli/index.js'
WARN Failed to create bin at /Users/nico/Documents/projects/react-email-2/packages/create-email/template/node_modules/.bin/email. ENOENT: no such file or directory, open '/Users/nico/Documents/projects/react-email-2/packages/react-email/dist/cli/index.js'
devDependencies:
+ @changesets/cli 2.27.7
+ @types/node 18.18.0
+ @types/react <- types-react 19.0.0-rc.1
+ @types/react-dom <- types-react-dom 19.0.0-rc.1
+ eslint 8.50.0
+ happy-dom 12.2.2
+ prettier 3.0.3
+ prettier-plugin-tailwindcss 0.6.6
+ tsconfig 0.0.0 <- packages/tsconfig
+ tsup 7.2.0
+ turbo 1.13.3
+ vite 5.0.13
+ vitest 0.34.6
WARN Failed to create bin at /Users/nico/Documents/projects/react-email-2/benchmarks/preview-server/node_modules/.bin/email. ENOENT: no such file or directory, open '/Users/nico/Documents/projects/react-email-2/benchmarks/preview-server/node_modules/react-email/dist/cli/index.js'
WARN 3 other warnings
Done in 5.9s
pnpm build output was large so put it in git gist
With the new instructions - even though the build fails pnpm dev
works after running build.
So the issue is happening when email build
is ran inside of apps/demo
. It seems to happen at the build step that runs npm install
inside of apps/demo/.react-email
. Could you try running npm install
there manually to see if you can get some more logs out of it?
@gabrielmfern running pnpm install
inside the apps/demo/.react-email
folder produces no errors. I dont use npm however running npm install
inside that directory results in:
>>> .react-email % npm install
npm error code EEXIST
npm error syscall rename
npm error path /Users/nico/.npm/_cacache/tmp/1437ebc1
npm error dest /Users/nico/.npm/_cacache/content-v2/sha512/70/75/299b8b0caf9d570250806789424cda9f98bac7dbd640eea8fc52c3c31e7f5327c7d0cbf8a1bbc7ca0aaf3e4fc6628925d811668c1e84647eca20052b2a20
npm error errno EEXIST
npm error Invalid response body while trying to fetch https://registry.npmjs.org/keyv: EACCES: permission denied, rename '/Users/nico/.npm/_cacache/tmp/1437ebc1' -> '/Users/nico/.npm/_cacache/content-v2/sha512/70/75/299b8b0caf9d570250806789424cda9f98bac7dbd640eea8fc52c3c31e7f5327c7d0cbf8a1bbc7ca0aaf3e4fc6628925d811668c1e84647eca20052b2a20'
npm error File exists: /Users/nico/.npm/_cacache/content-v2/sha512/70/75/299b8b0caf9d570250806789424cda9f98bac7dbd640eea8fc52c3c31e7f5327c7d0cbf8a1bbc7ca0aaf3e4fc6628925d811668c1e84647eca20052b2a20
npm error Remove the existing file and try again, or run npm
npm error with --force to overwrite files recklessly.
npm error A complete log of this run can be found in: /Users/nico/.npm/_logs/2024-09-02T18_10_37_789Z-debug-0.log```
@paradoxloop Even if you don't use npm, email build
does run it as it is the most reliable option by default. The .react-email
directory is mostly meant to be used on CI, so it shouldn't matter that much.
When looking at your error, it does seem like you ran sudo npm install
at some point, since the cache there seems to only be allowed access to administrators. Could you maybe try sudo npm cache clear --force
and then running npm install
again?
Describe the Bug
Following the instructions in Development section of the main react-email repository results in errors during install and dev.
I have tried a number of work of way of getting it to work ( building the repository first, changing pnpm version etc) to no avail.
50/50 chance I am doing something wrong but it might be a bug with a clean run of the repository
Which package is affected (leave empty if unsure)
react-email
Link to the code that reproduces this issue
NA
To Reproduce
Follow the instructions in Development section of read me.
Git clone the repository
Run
pnpm install
(completes successsfully but has warnings)run
pnpm dev
(fails to run)Extra: trying to build the repository runs into a similar but different error
Expected Behavior
The development instructions in the repository read me should work.
What's your node version? (if relevant)
v20.16.0