npm反应中抛出错误

时间:2017-01-24 12:50:38

标签: node.js reactjs npm

以下是我的代码,其中npm抛出错误。之前它工作正常,但是当我在不同的目录中复制相同的代码时,运行npm install,现在尝试运行npm start。抛出错误:

function myWayPoint() {
// Search form stick to top using waypoints.js
  if(window.innerWidth; > 768 && $("body").find('div').attr('id') == 'home'){
    var sticky = new Waypoint.Sticky({
      element: $('.thm-search')[0],
      offset:  54
    });
  }
}
myWayPoint();

代码是:

ERROR in ./www/plugins/entry.js
Module build failed: SyntaxError: Unexpected token (7:8)

5 | import routes from './routes/routes'
6 | 
> 7 | render((<Router history={browserHistory} routes={routes} />),document.getElementById('app'))

的package.json

import React from 'react';
import { render } from 'react-dom';
import { Router , browserHistory } from 'react-router';

import routes from './routes/routes';

render((<Router history={browserHistory} routes={routes} />), document.getElementById('app'));

0 个答案:

没有答案