npm ERR! missing script: start react project - npm

I am not able to run my react project. The version of npm and node are as follows:
node -v
v10.12.0
npm -v
6.5.0
package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-scripts": "2.1.1",
"web3": "^1.0.0-beta.37"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}

Related

POST http://localhost:3000/auth/register 500 (Internal Server Error)

When I run my project I GET THE proxy error :
Proxy error: Could not proxy request /auth/register from
localhost:3000 to http://127.0.0.1:8800/ (ECONNREFUSED).
I have tried numerous solutions by changing the URL in package.json and different things but could not get solution my package.json file is as follows:
{
"name": "booking",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.1.1",
"#testing-library/user-event": "^13.5.0",
"axios": "^1.2.4",
"dompurify": "^2.4.0",
"moment": "^2.29.4",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-quill": "^2.0.0",
"react-router-dom": "^6.4.1",
"react-scripts": "5.0.1",
"sass": "^1.55.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://127.0.0.1:8800/"
}
I tried to get a successful post request byt I get error with the GET POST .

npm run build successfully locally with npm audit fix. But how on Netlify?

I have done my client coding and wanted to build on Netlify. However, when I run build locally, I got error and have no clue of the TypeError.
So I run npm audit fix --force as instructed, and then npm run build, it succeeded.
My question is : how to fix the dependencies when deploying on Netlify or Vercel?
my package.json:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"#apollo/client": "^3.5.10",
"#emotion/react": "^11.8.2",
"#emotion/styled": "^11.8.1",
"#mui/icons-material": "^5.5.1",
"#mui/material": "^5.5.3",
"#testing-library/jest-dom": "^5.16.3",
"#testing-library/react": "^12.1.4",
"#testing-library/user-event": "^13.5.0",
"apollo-link-context": "^1.0.20",
"graphql": "^16.3.0",
"graphql-tag": "^2.12.6",
"jwt-decode": "^3.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-moment": "^1.1.1",
"react-router-dom": "^6.2.2",
"react-scripts": "5.0.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.1.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "https://fathomless-mountain-12345.herokuapp.com/"
}

I met problem with npm start in reactjs, what happen?

This is my package.json file:
{
"name": "front-end",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"boostrap": "^2.0.0",
"bootstrap": "^4.5.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"reactstrap": "^8.4.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
When I run npm start this is the message:
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\...\Roaming\npm-cache\_logs\2020-06-16T01_36_35_559Z-debug.log
You need to run this command in the same directory as your package.json, or a child directory. You can check the current directory with pwd and change it with cd NEW_DIRECTORY.

How to solve warnings from yarn

I did already solve:
warning " > react-native#0.54.3" has incorrect peer dependency "react#^16.3.0-alpha.1".
I just edit package.json dependencies:
...
"react": "^16.3.0-alpha.1",
...
and ran yarn.
But how can I solve following warnings:
warning "react-native > metro > #babel/plugin-check-constants#7.0.0-beta.38" has incorrect peer dependency "#babel/core#7.0.0-beta.38".
warning "jest-expo > babel-jest#22.4.3" has unmet peer dependency "babel-core#^6.0.0 || ^7.0.0-0".
my yarn version is 1.5.1
my whole package.json:
{
"name": "#######",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "^25.1.0",
"react-native-scripts": "^1.11.1",
"react-test-renderer": "^16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"#expo/vector-icons": "^6.3.1",
"exp": "^47.4.4",
"expo": "^23.0.4",
"react": "^16.3.0-alpha.1",
"react-native": "^0.54.3",
"react-navigation": "^1.5.8"
}
}

devDependencies "module not found" error

I separated my dependencies between devDependencies and dependencies
{
"name": "contenttype",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.3.2",
"react-dom": "^15.3.2"
},
"scripts": {
"dev": "webpack-dev-server --content-base src --inline --hot"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-loader": "^6.2.7",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"webpack": "^1.13.3"
}
}
As you can see I have an npm script, but when I run npm run dev, I get the error
webpack module not found
Why is that? The webpack module is in my devDependencies, so why isn't it being recongnized?
npm install webpack-dev-server --save-dev