Module not found: Error: cannot resolve 'reaction-bootstrap-validation'

Problem

I keep getting the following error in webpack

Error: Cannot find module 'react-bootstrap-validtion'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)

Am I installing the module incorrectly or incorrectly?

Here's how I did it, following the example on the official website. ( https://www.npmjs.com/package/react-bootstrap-validation )


Environment

This is the node environment I'm working with

npm -v
3.10.7

nvm version
v5.11.1

node -v
v5.11.1

This is how I installed the module

npm install --save react-bootstrap-validation


Component response

This is how I implemented the React component

import React, {Component} from 'react'
import { ButtonInput } from 'react-bootstrap'
import { Form } from 'react-bootstrap-validation'

export default class LoginForm extends Component {

  constructor(props) {
    super(props)
    this.state = {
      showModal: false,
      email: '',
      password: ''
    }
  }

  _handleValidSubmit(values) {}
  _handleInvalidSubmit(errors, values) {}

  render() {
    return (
      <div>
        <div className="account">
          <div className="container">
            <div className="page-title">Login</div>
            <div className="page-desc">Email used at sign up</div>
            <Form
              onValidSubmit={this._handleValidSubmit.bind(this)}
              onInvalidSubmit={this._handleInvalidSubmit.bind(this)}>
              <ValidatedInput
                type="text"
                label="Email"
                name="email"
                validate="required,isEmail"
                errorHelp={{
                  required: "Please enter your e-mail",
                  isEmail: "Email is invalid"
                }}
              />

              <ValidatedInput
                type="password"
                label="Password"
                name="password"
                validate="required,isLength:6:60"
                errorHelp={{
                  required: "Please specify a password",
                  isEmail: "Password must be at least 6 characters"
                }}
              />

              <ButtonInput
                type="submit"
                bsSize="large"
                bsStyle="primary"
                value="LOGIN"
              />
            </Form>
          </div>
        </div>
      </div>
    )
  }
}
+4
source share
1 answer

A module error was not found when you use any module, and this module is not installed or node cannot find this module due to the wrong path.

, ,

- - .

, Root sudo, yoy ubuntu.

, , : -

npm install react-bootstrap-validtion --save

linux/ubuntu, : -

sudo npm install react-bootstrap-validtion --save

,

,

, , , npm.

, !

+4

Source: https://habr.com/ru/post/1654088/


All Articles