react npm test 的失败



 return (
      <div>
        <header className="toolbar">
          <span className="toolbar__title"> Todo List  </span>
        </header>
        <main className="main">
          <span className="main__title">Todo List</span>
          <form className={containerClass} onSubmit={this.handleAddTodo}>
            <input className="main__new-todo-container__input" ref="newTodoContent" placeholder="New Todo" />
            <button className="main__new-todo-container__confirm" type="submit" dangerouslySetInnerHTML={{__html: confirmIcon}}></button>
          </form>
          <Todos todos={ this.state.todos } onTodoDelete={ TodoActions.remove } onTodoUpdate={ TodoActions.change } />
          <button className={addTodoButtonClass} onClick={this.toggleMode} dangerouslySetInnerHTML={{__html: addIcon}}></button>
        </main>
      </div>
    );

报错信息如下


 zandeMacBook-Pro:todo juluad$ npm run lint

> [email protected] lint /Users/www/react/todo
> eslint ./app ./server.js


/Users/www/react/todo/app/components/App/index.js
  64:56  error  Multiple spaces found before '<'  no-multi-spaces

✖ 1 problem (1 error, 0 warnings)


npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "lint"
npm ERR! node v4.2.0
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] lint: `eslint ./app ./server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] lint script 'eslint ./app ./server.js'.
npm ERR! This is most likely a problem with the todo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint ./app ./server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls todo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/www/react/todo/npm-debug.log
zandeMacBook-Pro:todo juluad$

图片描述

reactjs npm node.js

icemaze 9 years, 2 months ago

Your Answer