2017-02-17 18 views
5

Tôi chỉ chuyển dự án của tôi từ máy này sang máy khác, và khi tôi chạy webpack --watch tôi nhận được lỗi sau:Webpack Lỗi Cú pháp: dấu hiệu bất ngờ =>

C:\Users\joe_coolish\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:186 
       outputOptions.children = options.map(o => o.stats); 
                 ^^ 
SyntaxError: Unexpected token => 
    at exports.runInThisContext (vm.js:73:16) 
    at Module._compile (module.js:443:25) 
    at Object.Module._extensions..js (module.js:478:10) 
    at Module.load (module.js:355:32) 
    at Function.Module._load (module.js:310:12) 
    at Function.Module.runMain (module.js:501:10) 
    at startup (node.js:129:16) 
    at node.js:814:3 

Cùng cài đặt chính xác trên transpiles máy tính khác của tôi mà không cần bất kỳ vấn đề. Điều gì có thể gây ra điều này?

phiên bản My Webpack là [email protected]

tôi đã chạy npm install trong thư mục ứng dụng của tôi. packages.json của tôi là:

{ 
    "version": "1.0.0", 
    "name": "unlimitlists", 
    "private": true, 
    "devDependencies": { 
    "@types/node": "^7.0.5", 
    "bower": "^1.7.9", 
    "grunt": "^0.4.5", 
    "grunt-bower-task": "^0.4.0", 
    "grunt-cli": "^0.1.13", 
    "grunt-contrib-clean": "^0.7.0", 
    "grunt-contrib-imagemin": "^1.0.0", 
    "grunt-contrib-less": "~1.2.0", 
    "grunt-typescript": "^0.8.0", 
    "promise": "~7.1.1", 
    "rimraf": "^2.5.2" 
    }, 
    "dependencies": { 
    "angular-hotkeys": "^1.7.0", 
    "babel-core": "^6.17.0", 
    "babel-loader": "^6.2.5", 
    "es6-promise": "^4.0.5", 
    "isomorphic-fetch": "^2.2.1", 
    "jquery": "^3.1.1", 
    "react": "^15.3.2", 
    "react-dom": "^15.3.2", 
    "react-redux": "^4.4.5", 
    "react-router": "^2.8.1", 
    "react-router-redux": "^4.0.6", 
    "redux": "^3.6.0", 
    "redux-actions": "^0.12.0", 
    "redux-thunk": "^2.1.0", 
    "skrollr-menu-typed": "^1.0.4", 
    "skrollr-typed": "^0.6.31" 
    } 
} 

Trả lời

8

Vâng, tôi cảm thấy ngớ ngẩn ...

tôi chỉ làm một node --version và nó xuất hiện với v0.12.2 giá trị

Chỉ cần cài đặt v7.5.0 và mọi thứ hoạt động tốt ngay bây giờ.

+3

Cảm ơn joe! Vì vậy, chúng tôi là hai để cảm thấy câm ngay bây giờ. – 1ronmat

+1

Đó cũng là kịch bản trong trường hợp của tôi. Cảm ơn. – kta

Các vấn đề liên quan