shadcn-ui / taxonomy

An open source application built using the new router, server components and everything new in Next.js 13.
https://tx.shadcn.com
MIT License
18.64k stars 2.58k forks source link

doesn't work with NPM #157

Open AyushKoul00 opened 1 year ago

AyushKoul00 commented 1 year ago

When I cloned the repo and ran npm i, it gave these issues:

npm ERR!   node_modules/@next-auth/prisma-adapter
npm ERR!     @next-auth/prisma-adapter@"^1.0.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\<USER>\AppData\Local\npm-cache\_logs\2023-05-28T15_20_21_673Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\<USER>\AppData\Local\npm-cache\_logs\2023-05-28T15_20_21_673Z-debug-0.log

I then ran npm i --legacy-peer-deps which resolved the issues above but then when I run npm run dev I get these errors:

[1] ready - started server on 0.0.0.0:3000, url: http://localhost:3000
[1] info  - Loaded env from C:\DEV\Web\taxonomy\.env.local
[0] Warning: Contentlayer might not work as expected on Windows
[0] Contentlayer config change detected. Updating type definitions and data...
[1] āŒ Invalid environment variables: {
[1]   NEXTAUTH_SECRET: [ 'String must contain at least 1 character(s)' ],
[1]   GITHUB_CLIENT_ID: [ 'String must contain at least 1 character(s)' ],
[1]   GITHUB_CLIENT_SECRET: [ 'String must contain at least 1 character(s)' ],
[1]   GITHUB_ACCESS_TOKEN: [ 'String must contain at least 1 character(s)' ],
[1]   SMTP_FROM: [ 'String must contain at least 1 character(s)' ],
[1]   POSTMARK_API_TOKEN: [ 'String must contain at least 1 character(s)' ],
[1]   POSTMARK_SIGN_IN_TEMPLATE: [ 'String must contain at least 1 character(s)' ],
[1]   POSTMARK_ACTIVATION_TEMPLATE: [ 'String must contain at least 1 character(s)' ],
[1]   STRIPE_API_KEY: [ 'String must contain at least 1 character(s)' ],
[1]   STRIPE_WEBHOOK_SECRET: [ 'String must contain at least 1 character(s)' ],
[1]   STRIPE_PRO_MONTHLY_PLAN_ID: [ 'String must contain at least 1 character(s)' ]
[1] }
[1] error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
[1] Error: Invalid environment variables
[1]     at f (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:505)
[1]     at l (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:695)
[1]     at C (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:868)
[1]     at file:///C:/DEV/Web/taxonomy/env.mjs:4:20
[1]     at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
[1]     at async Promise.all (index 0)
[1]     at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
[1]     at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
[1]     at async loadConfig (C:\DEV\Web\taxonomy\node_modules\next\dist\server\config.js:528:36)
[1]     at async NextServer.prepare (C:\DEV\Web\taxonomy\node_modules\next\dist\server\next.js:153:24) {
[1]   type: 'Error'
[1] }
[1] next dev exited with code 1
[0] Generated 15 documents in .contentlayer
Das-Sayan2003 commented 1 year ago

Use PNPM to install the dependencies I used NPM ar first..but was not working. PNPM is also a packege manager like NPM

AyushKoul00 commented 1 year ago

I used pnpm also. Getting same issue. I think it is because of the env variables. Do we have to provide all the env variables in order for this project to work?

DanieleSalatti commented 1 year ago
[1] āŒ Invalid environment variables: {
[1]   NEXTAUTH_SECRET: [ 'String must contain at least 1 character(s)' ],
[1]   GITHUB_CLIENT_ID: [ 'String must contain at least 1 character(s)' ],
[1]   GITHUB_CLIENT_SECRET: [ 'String must contain at least 1 character(s)' ],
[1]   GITHUB_ACCESS_TOKEN: [ 'String must contain at least 1 character(s)' ],
[1]   SMTP_FROM: [ 'String must contain at least 1 character(s)' ],
[1]   POSTMARK_API_TOKEN: [ 'String must contain at least 1 character(s)' ],
[1]   POSTMARK_SIGN_IN_TEMPLATE: [ 'String must contain at least 1 character(s)' ],
[1]   POSTMARK_ACTIVATION_TEMPLATE: [ 'String must contain at least 1 character(s)' ],
[1]   STRIPE_API_KEY: [ 'String must contain at least 1 character(s)' ],
[1]   STRIPE_WEBHOOK_SECRET: [ 'String must contain at least 1 character(s)' ],
[1]   STRIPE_PRO_MONTHLY_PLAN_ID: [ 'String must contain at least 1 character(s)' ]
[1] }

Taxonomy uses a library to validate env vars at start, you need to fill at least all the ones listed in the error message.

Vlad-CSA commented 1 year ago

Yeah, need to provide all or remove some from env.mjs and from code accordingly

VedP20 commented 1 year ago

Getting the same error, Is there any fix?

DanieleSalatti commented 1 year ago

Getting the same error, Is there any fix?

It's a user error šŸ™‚ You need to provide the env variables.

VedP20 commented 1 year ago

where can I get them?

sytpb commented 1 year ago

the same problem , where to get ?

Vlad-CSA commented 1 year ago

Well, you need to register and set up all these services, or almost all of them (I didn't set up the build, I just put a plug in) Use your brain and AI to figure out these .env

rahXephonz commented 1 year ago

jus create a .env and then create your environment

justiny commented 1 year ago

If you just want to get it running, without setting up these services, you can comment out the code in env.mjs, then run pnpm dev. Make sure to run pnpm install first.

vaynevayne commented 1 year ago
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/vayne/github/taxonomy/node_modules/.pnpm/@contentlayer+core@0.3.1_esbui
brrock commented 2 months ago

When I cloned the repo and ran npm i, it gave these issues:


npm ERR!   node_modules/@next-auth/prisma-adapter

npm ERR!     @next-auth/prisma-adapter@"^1.0.6" from the root project

npm ERR!

npm ERR! Fix the upstream dependency conflict, or retry

npm ERR! this command with --force or --legacy-peer-deps

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

npm ERR!

npm ERR!

npm ERR! For a full report see:

npm ERR! C:\Users\<USER>\AppData\Local\npm-cache\_logs\2023-05-28T15_20_21_673Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\<USER>\AppData\Local\npm-cache\_logs\2023-05-28T15_20_21_673Z-debug-0.log

I then ran npm i --legacy-peer-deps which resolved the issues above but then when I run npm run dev I get these errors:


[1] ready - started server on 0.0.0.0:3000, url: http://localhost:3000

[1] info  - Loaded env from C:\DEV\Web\taxonomy\.env.local

[0] Warning: Contentlayer might not work as expected on Windows

[0] Contentlayer config change detected. Updating type definitions and data...

[1] āŒ Invalid environment variables: {

[1]   NEXTAUTH_SECRET: [ 'String must contain at least 1 character(s)' ],

[1]   GITHUB_CLIENT_ID: [ 'String must contain at least 1 character(s)' ],

[1]   GITHUB_CLIENT_SECRET: [ 'String must contain at least 1 character(s)' ],

[1]   GITHUB_ACCESS_TOKEN: [ 'String must contain at least 1 character(s)' ],

[1]   SMTP_FROM: [ 'String must contain at least 1 character(s)' ],

[1]   POSTMARK_API_TOKEN: [ 'String must contain at least 1 character(s)' ],

[1]   POSTMARK_SIGN_IN_TEMPLATE: [ 'String must contain at least 1 character(s)' ],

[1]   POSTMARK_ACTIVATION_TEMPLATE: [ 'String must contain at least 1 character(s)' ],

[1]   STRIPE_API_KEY: [ 'String must contain at least 1 character(s)' ],

[1]   STRIPE_WEBHOOK_SECRET: [ 'String must contain at least 1 character(s)' ],

[1]   STRIPE_PRO_MONTHLY_PLAN_ID: [ 'String must contain at least 1 character(s)' ]

[1] }

[1] error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error

[1] Error: Invalid environment variables

[1]     at f (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:505)

[1]     at l (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:695)

[1]     at C (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:868)

[1]     at file:///C:/DEV/Web/taxonomy/env.mjs:4:20

[1]     at ModuleJob.run (node:internal/modules/esm/module_job:193:25)

[1]     at async Promise.all (index 0)

[1]     at async ESMLoader.import (node:internal/modules/esm/loader:530:24)

[1]     at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)

[1]     at async loadConfig (C:\DEV\Web\taxonomy\node_modules\next\dist\server\config.js:528:36)

[1]     at async NextServer.prepare (C:\DEV\Web\taxonomy\node_modules\next\dist\server\next.js:153:24) {

[1]   type: 'Error'

[1] }

[1] next dev exited with code 1

[0] Generated 15 documents in .contentlayer

U haven't setup envs it looks like