teslamotors/informed

upon using npm run dev command its throwing an error

samr874 opened this issue · 27 comments

I want to run the application by using npm run dev
I am getting this error how to resolve this issue by using which commands
![image](https://github.com/teslamotors/informed/assets/60845180/a7376bcc-a091-44ad-a4d2-fca530eb9fd7)

try npm run start

try npm run start

but its saying that D:/informed/dist/esm this file is missing
image
what to do is it the same case from your end??

ahhh can you run npm run build first

This app is not running and the content is not getting displayed

I think I need to update README

npm run build

npm run start 

Build will build the source code

Start will start a dev server for the docs

Note, you need to re build if you make code changes to src for them to take affect in the local docs

@joepuzzo Thank you will try to update it will follow the solutions as follows

@joepuzzo actually the error http://localhost:5173/informed/dist/esm this url is throwing response as 404 not found

  1. Are you running at least node version 18
  2. Did you make sure to npm install everything
  3. You ran npm run build
  4. You ran npm start ?

I just did all the following and see no issues

just try to inspect the application @joepuzzo this http://localhost:5173/informed/dist/esm URL is throwing the problem

That tells me you did not have a successful build after npm run build

This is what a successful build looks like

so I have to pull from master branch as per your terminal

what is your solution to this

  1. Are you running at least node version 18
  2. Did you make sure to npm install everything
  3. You ran npm run build
  4. You ran npm start ?

I just did all the following and see no issues

yes I did everything but still the same issue

There is no problem to fix.. there is simply following the layed out.

  1. Are you running at least node version 18
  2. Did you make sure to npm install everything
  3. You ran npm run build
  4. You ran npm start ?

your error indicates that you never successfully build the code with npm run build. You need to get that to happen.

let me ask you this... do you have a dist directory that was created after you ran npm run build ?

And in that directory do you have an esm directory ?

no there is no dist directory

Then the build never succeeded. Are you on a mac or windows machine?

I am on windows
what to do now

run a terminal that has bash. you can google how to do this. The problem is all development done on this project is done on mac or linux and the build command relys on a few unix commands so thats prob why its failing.

Just google "how to run bash terminal on windows"

are you sure will it work but what difference does it make of os

Ha literally its just this https://github.com/teslamotors/informed/blob/master/package.json#L23

The fact that it runs a rm -rf dist && rollup that is unix command / syntax to run stuff.

so yes if you run in a terminal that supports unix/linux commands it should work fine

Why are you trying to run this locally in the first place may I ask ? Are you looking to contribute? Learn? Test?

@joepuzzo thank you so much now it's working

so the contributors working on windows os.
use this as script "build": "rimraf dist && rollup --config && npm run fix:cjs"