Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React - run dev-server

Tags:

npm

reactjs

cmd

  • clone the git code in react.
  • install npm.

problem -

for some reason i cant run dev-server . I treid this two command on cmd 1. npm run dev-server

"sample" for 1 of the error i get -

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration . C:\Users\Alon\Desktop\skillz_fontend\src\components\Inputs\GooglePlacesInput.jsx 57:30 error Missing semicolon semi

  1. npm start -

C:\Users\Alon\Desktop\skillz_fontend>npm start npm ERR! missing script: start npm ERR! npm ERR! Did you mean this? npm ERR! stats npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Alon\AppData\Roaming\npm-cache_logs\2019-11-17T22_59_13_787Z-debug.log

thanks Alon

like image 469
aloneliyau Avatar asked Nov 17 '19 23:11

aloneliyau


People also ask

How do I run a dev server in React?

Using create-react-app We will first install the create-react-app globally. Then we create a project using create-react-app command. And then all we have to do is just run npm run start . And that's it.

How do I deploy React app to developer server?

Configure the deploy settings. Select a default branch to deploy (you can choose the master branch or any other branch) and ensure that the build command is npm run build and the publish directory is /build . Click Deploy site, and your React app will be deployed on Netlify's remote server.


2 Answers

When you see a warning like this:

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .

Try adding React version settings in your eslint configuration file, such as .eslintrc.js, like below:

// .eslintrc.js
{
  ...
  settings: {
    react: {
      version: 'detect',
    },
  },
}
like image 51
Yuci Avatar answered Oct 18 '22 00:10

Yuci


module.exports = {
  env: {
    browser: true,
    es2021: true,
    jest: true,
    'react-native/react-native': true,
  },
  extends: [
    'eslint:recommended',
    'plugin:react/recommended',
    'plugin:react-hooks/recommended',
    'plugin:react-native/all',
  ],
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 12,
    sourceType: 'module',
  },
  plugins: ['react', 'react-hooks', 'react-native'],
  rules: {
    'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
    'global-require': 0,
    'operator-linebreak': [2, 'before'],
  },

  settings: {
    react: {
      version: "detect"
    }
  }
};
like image 31
AN German Avatar answered Oct 17 '22 23:10

AN German