I'm trying to build a web app project from GitHub, specifically from the repository at github.com/whscullin/apple1js. I'm new to programming, Git, and GitHub, so I'm following the instructions in the README file, which seem straightforward. However, when I run the code, I encounter several errors related to npm. The main error is: "TS5083: Cannot read file 'node_modules/@whscullin/cpu6502/tsconfig.json'." I did some research and found that this might be due to a submodule not installing correctly, although my terminal suggested everything was fine. I'd really appreciate any guidance on how to resolve this issue! I'm using Linux.
5 Answers
The error you're seeing usually means that the `@whscullin/cpu6502` folder exists, but its TypeScript files didn't clone properly, often due to not including submodules when cloning the project. Try the following steps: 1) Remove your current clone with `rm -rf apple1js`. 2) Then, clone it again with `git clone --recurse-submodules https://github.com/whscullin/apple1js.git`. 3) Go into the project folder and run `npm install`, then `npm run build` to build it again. That should pull in all the necessary files, including `tsconfig.json`. If you still run into issues, let me know!
It sounds like you're close! This is probably due to missing a step for GitHub projects with submodules. After cloning, use `git submodule update --init --recursive` to load in the necessary submodule files, then run `npm install` and `npm run build`. If you still see the error, try removing the `node_modules` folder and reinstalling with `npm install`. Once the build is successful, you can run the app with `npm start`. Let me know how it goes!
I appreciate that! Unfortunately, I'm still seeing the same error even after trying that.
No worries, it sounds like you just forgot to pull the `cpu6502` submodule. Maybe I can help! On Linux, try running `git submodule update --init --recursive` to pull in that blip. After that, make sure to run `npm install` correctly, and everything should sync up! If you run into any errors after that, check if there are any files or folders missing after the install.
Thanks for the help! The output still shows errors following the npm install though.
First, make sure you have npm installed. When you run the commands `git submodule init` and `git submodule update`, do you see any issues? You should be inside the repo folder when executing these commands. If I cloned it without initializing submodules, I'd get similar errors to what you're experiencing. Let me know what those commands say!
I can't log into the site on my PC right now, but running those commands didn't show any errors. One said the submodule was registered, and the other confirmed it was checked out.
Can you provide the exact commands you're running, starting from when you cloned the repository? It would help to see the whole process.
Sure! Here are the commands I've been using: `git clone https://github.com/whscullin/apple1js.git`, then `cd apple1js`, followed by `git submodule init`, `git submodule update`, and finally `npm install`.

Thanks for the suggestion! Unfortunately, I still got the same error message even after reinstalling.