当我在我的react.js项目中录制yarn check
时,出现此错误
yarn check v1.16.0
info fsevents@2.0.6: The platform "linux" is incompatible with this module.
info "fsevents@2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
warning "react-scripts#babel-jest@^24.8.0" could be deduped from "24.8.0" to "babel-jest@24.8.0"
warning "react-scripts#babel-preset-react-app#@babel/plugin-transform-react-constant-elements@7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-react-constant-elements@7.2.0"
warning "react-scripts#babel-preset-react-app#@babel/plugin-transform-react-display-name@7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-react-display-name@7.2.0"
warning "react-scripts#babel-preset-react-app#@babel/preset-react@7.0.0" could be deduped from "7.0.0" to "@babel/preset-react@7.0.0"
warning "react-scripts#babel-jest#@babel/core@^7.0.0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "react-scripts#babel-loader#@babel/core@^7.0.0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "react-scripts#babel-plugin-named-asset-import#@babel/core@^7.1.0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "jest-resolve#jest-pnp-resolver#jest-resolve@*" could be deduped from "24.8.0" to "jest-resolve@24.8.0"
warning "webpack#chrome-trace-event#tslib@^1.9.0" could be deduped from "1.10.0" to "tslib@1.10.0"
warning "babel-preset-react-app#@babel/plugin-proposal-class-properties#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-proposal-decorators#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-proposal-object-rest-spread#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-syntax-dynamic-import#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-classes#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-destructuring#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-flow-strip-types#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-react-display-name#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-runtime#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-proposal-async-generator-functions@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-proposal-async-generator-functions@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-proposal-json-strings@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-proposal-json-strings@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-proposal-optional-catch-binding@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-proposal-optional-catch-binding@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-proposal-unicode-property-regex@^7.4.0" could be deduped from "7.4.4" to "@babel/plugin-proposal-unicode-property-regex@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-syntax-async-generators@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-syntax-async-generators@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-syntax-optional-catch-binding@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-syntax-optional-catch-binding@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-arrow-functions@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-arrow-functions@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-async-to-generator@^7.4.0" could be deduped from "7.4.4" to "@babel/plugin-transform-async-to-generator@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-block-scoped-functions@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-block-scoped-functions@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-block-scoping@^7.4.0" could be deduped from "7.4.4" to "@babel/plugin-transform-block-scoping@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-computed-properties@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-computed-properties@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-dotall-regex@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-dotall-regex@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-duplicate-keys@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-duplicate-keys@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-exponentiation-operator@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-exponentiation-operator@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-for-of@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-for-of@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-function-name@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-function-name@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-literals@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-literals@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-member-expression-literals@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-member-expression-literals@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-modules-amd@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-modules-amd@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-modules-commonjs@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-modules-commonjs@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-modules-systemjs@^7.4.0" could be deduped from "7.4.4" to "@babel/plugin-transform-modules-systemjs@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-modules-umd@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-modules-umd@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-named-capturing-groups-regex@^7.4.2" could be deduped from "7.4.4" to "@babel/plugin-transform-named-capturing-groups-regex@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-new-target@^7.4.0" could be deduped from "7.4.4" to "@babel/plugin-transform-new-target@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-object-super@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-object-super@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-parameters@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-parameters@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-property-literals@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-property-literals@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-regenerator@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-regenerator@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-reserved-words@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-reserved-words@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-spread@^7.2.0" could be deduped from "7.2.2" to "@babel/plugin-transform-spread@7.2.2"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-template-literals@^7.2.0" could be deduped from "7.4.4" to "@babel/plugin-transform-template-literals@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-typeof-symbol@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-transform-typeof-symbol@7.2.0"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-transform-unicode-regex@^7.4.3" could be deduped from "7.4.4" to "@babel/plugin-transform-unicode-regex@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/preset-react#@babel/plugin-transform-react-display-name@^7.0.0" could be deduped from "7.2.0" to "@babel/plugin-transform-react-display-name@7.2.0"
warning "babel-preset-react-app#@babel/preset-react#@babel/plugin-transform-react-jsx@^7.0.0" could be deduped from "7.3.0" to "@babel/plugin-transform-react-jsx@7.3.0"
warning "babel-preset-react-app#@babel/preset-react#@babel/plugin-transform-react-jsx-self@^7.0.0" could be deduped from "7.2.0" to "@babel/plugin-transform-react-jsx-self@7.2.0"
warning "babel-preset-react-app#@babel/preset-react#@babel/plugin-transform-react-jsx-source@^7.0.0" could be deduped from "7.2.0" to "@babel/plugin-transform-react-jsx-source@7.2.0"
warning "babel-preset-react-app#@babel/preset-typescript#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "react-scripts#babel-jest#babel-preset-jest#@babel/core@^7.0.0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "@typescript-eslint/eslint-plugin#tsutils#tslib@^1.8.1" could be deduped from "1.10.0" to "tslib@1.10.0"
warning "eslint#inquirer#rxjs#tslib@^1.9.0" could be deduped from "1.10.0" to "tslib@1.10.0"
warning "babel-preset-react-app#@babel/plugin-proposal-class-properties#@babel/helper-create-class-features-plugin#@babel/core@^7.0.0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/preset-env#@babel/plugin-proposal-async-generator-functions#@babel/plugin-syntax-async-generators@^7.2.0" could be deduped from "7.2.0" to "@babel/plugin-syntax-async-generators@7.2.0"
warning "babel-preset-react-app#@babel/plugin-proposal-decorators#@babel/plugin-syntax-decorators#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-flow-strip-types#@babel/plugin-syntax-flow#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "@babel/preset-react#@babel/plugin-transform-react-display-name#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
error "babel-preset-react-app#@babel/preset-react#@babel/plugin-transform-react-jsx-self" not installed
error "babel-preset-react-app#@babel/preset-react#@babel/plugin-transform-react-jsx-source" not installed
warning "babel-preset-react-app#@babel/preset-typescript#@babel/plugin-transform-typescript#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "babel-preset-react-app#@babel/plugin-transform-typescript#@babel/plugin-syntax-typescript#@babel/core@^7.0.0-0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
warning "jest-config#babel-jest#@babel/core@^7.0.0" could be deduped from "7.4.4" to "@babel/core@7.4.4"
error "babel-jest#babel-preset-jest" not installed
info Found 68 warnings.
error Found 3 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
我尝试使用yarn install
进行修复,但没有任何变化,并表明它们都是最新的
yarn install v1.16.0
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.85s.
我不知道是什么原因造成的,以及如何解决它。
答案 0 :(得分:1)
首先删除您的node_modules和yarn.lock,然后重新运行yarn install
// sigin route
router.post('/signin', (req, res) => {
db.select('email', 'hash').from('login')
.where('email', '=', req.body.email)
.then(data => {
const isValid = bcrypt.compareSync(req.body.password, data[0].hash);
if (isValid) {
db.select('*').from('users')
.where('email', '=', req.body.email)
.then(user => {
res.json(user[0])
})
.catch(err => res.status(400).json('unable to get user'))
}
})
.catch(err => res.status(400).json('Wrong Credentials'))
})