0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

React エラー集(随時更新)

Last updated at Posted at 2019-12-15

Refusing to install package with name

package.jsonのnameとnpm installしようとしているパッケージ名が被っているときにでるエラー。
解決策 package.jsonのnameを変更する。

prettierいれてるのにeslintrc未設定なのは豚に真珠

pm install eslint eslint-config-prettier eslint-plugin-prettier -D

これらのツールをいれるとprettierがやったことにeslintは口を出さなくなる(警告しなくなる!)
https://qiita.com/soarflat/items/06377f3b96964964a65d
知らずに悪戦苦闘しながらルール追加していた(約2日間)

eslint: cannot find module 'prettier' require stack.

prettierがローカルに入ってないと怒られます。

npm install --save-dev prettier

[eslint] is not defined

.eslintrc.js
"env": {
  node: true,
  commonjs: true,
  browser: true,
  es6: true
}

[eslint] eslint-disable react/prop-types

警告を消す

.eslintrc.js
rules: {
  "react/prop-types": 0
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?