So I’m learning how to be a front end web developer and the site I’m learning on has me making a portfolio project of an app. However I’m having a problem that I hadn’t run into before in VS. I finished coding my app and I’m ready for debugging, however when I try I get: An error occurred while launching the application. Seems to be that you are trying to debug from within directory that is not a React Native project root. If so, please, follow these instructions: https://github.com/microsoft/vscode-react-native#customization (error code 604) (error code 303)
I tried moving the launch json into the app folder but it stops recognizing it as a debug option.
I’ve also tried just using the command terminal but it doesn’t recognize npm as a command so I’m not sure what to do with that.
my launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Windows",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"platform": "windows"
}
]
}
I also have a manifest.json and a package.json that I grabbed directly from the sample project:
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
{
"name": "jammming",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
(there’s a debug button above scripts that when pressed throws the aforementioned npm error)
here’s a screenshot of my file layout:
my file layout in visual studio code
Let me know if you need anything else to help me out.
Kawaii concept is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.