epicweb-dev / full-stack-foundations

Learn the foundational skills of building full stack web applications.

Home Page:https://epicweb.dev/workshops/full-stack-foundations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm start error after setup successful

JuicyZest opened this issue Β· comments

i've installed the setup in VSC. I'm following the tutorial using command >code playground, then running npm start as said and I have an error, build folder is missing. Should I run npm build first ?


PS C:\APP\epicreact\full-stack-foundations\playground> npm start

> start
> remix-serve build

Error: ENOENT: no such file or directory, stat 'C:\APP\epicreact\full-stack-foundations\playground\build'
    at Object.statSync (node:fs:1688:3)
    at reimportServer (C:\APP\epicreact\full-stack-foundations\playground\node_modules\@remix-run\serve\dist\cli.js:84:39)
    at run (C:\APP\epicreact\full-stack-foundations\playground\node_modules\@remix-run\serve\dist\cli.js:113:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
I've tried to run npm build, then npm start again and I have a different error : 
   PS C:\APP\epicreact\full-stack-foundations\playground> npm run build

> build
> run-s build:*


> build:remix
> remix build --sourcemap

 info  building... (NODE_ENV=production)
 warn  🚨  source maps enabled in production
┃ You are using `--sourcemap` to enable source maps in production,
┃ making your server-side code publicly visible in the browser.
┃ This is highly discouraged!
┃ If you insist, ensure that you are using environment variables for secrets
┃ and are not hard-coding them in your source.
β”—
 info  built (1s)

> build:server
> tsx ./other/build-server.ts


building...

  server-build\index.js      3.8kb
  server-build\index.js.map  8.0kb

Done in 28ms
PS C:\APP\epicreact\full-stack-foundations\playground> npm start

> start
> remix-serve build

Error: Directory import 'C:\APP\epicreact\full-stack-foundations\playground\build' is not supported resolving ES modules imported from C:\APP\epicreact\full-stack-foundations\playground\node_modules\@remix-run\serve\dist\cli.js
Did you mean to import C:/APP/epicreact/full-stack-foundations/playground/build/index.js?
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:321:11)
    at moduleResolve (node:internal/modules/esm/resolve:980:10)
    at defaultResolve (node:internal/modules/esm/resolve:1193:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:403:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:372:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:249:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:335:34)
    at importModuleDynamically (node:internal/modules/cjs/loader:1284:37)
    at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)

found that you run code playground, which opens up the playground part in vsc, but you actually want to run npm start from the full-stack-foundations folder

Glad you got it working! Make sure to watch the onboarding video as well :) https://www.epicweb.dev/get-started