radiasoft / sirepo

Sirepo is a framework for scientific cloud computing. Try it out!
https://sirepo.com
Apache License 2.0
64 stars 31 forks source link

20221123 Cannot find module 'typescript' #5063

Closed robnagler closed 1 year ago

robnagler commented 1 year ago

How do we upgrade our local react build environments?

Error: Cannot find module 'typescript' from '/home/vagrant/src/radiasoft/sirepo/react/node_modules'

garsuga commented 1 year ago

I think we need to run npm install when switching branches. Normally this would need to be done every time since node_modules is untracked.

garsuga commented 1 year ago

I have been placing all of the packages in react/node_modules so try running npm install from the react folder

robnagler commented 1 year ago

npm install worked. Perhaps we could have a sentinel that figures out if npm install needs to be called again inside pkcli.service.http. It's only necessary for that. I changed this issue title to reflect that. It might be that it could be run every time, since webpack is the slow part.

robnagler commented 1 year ago

@garsuga did you see this from @gurhar1133?

/home/vagrant/src/radiasoft/sirepo/react/node_modules/react-scripts/scripts/start.js:19
  throw err;
garsuga commented 1 year ago

No, I did not, what is this referring to?

gurhar1133 commented 1 year ago

When I run sirepo service http I run into that error. I've been using the workaround Paul gave me: "One work-around is to disable react when you start the server: SIREPO_PKCLI_SERVICE_REACT_PORT= sirepo service http"

garsuga commented 1 year ago

I cloned into a new directory on master and ran npm install in both the root and react directory (that's important since they are different node projects) and I cannot recreate this error

robnagler commented 1 year ago

There may be a problem with cloning a new repo as opposed to git pull on an existing one that is out of date.

garsuga commented 1 year ago

Is this still an issue on latest?

gurhar1133 commented 1 year ago

Is this still an issue on latest?

working for me now @robnagler @garsuga