2016-06-10 84 views
0

我即將在ECS服務器上部署我的項目。它可以在本地機器上正常工作,但是在正常程序之後,npm run build然後是npm run start。應用程序退出時出現非常有線的錯誤。TypeError:對象IE <= 11沒有方法'startsWith'

/root/redux-blog/public/assets/server.js:1 
on(e,t,n){"use strict";function r(e,t,n,r){if(e===n)return !0;if(!n.startsWith 
                    ^
TypeError: Object IE <= 11 has no method 'startsWith' 
    at r (server.js:4:4318) 
    at Object.isBrowser (server.js:4:4530) 
    at Object.isBrowser (server.js:42:27341) 
    at Object.<anonymous> (server.js:41:15829) 
    at t (server.js:1:182) 
    at Object.module.exports.Object.create.constructor.value (server.js:41:11850) 
    at t (server.js:1:182) 
    at Object.<anonymous> (server.js:41:3056) 
    at t (server.js:1:182) 
    at Object.module.exports.n (server.js:41:7630) 
npm ERR! weird error 8 
npm WARN This failure might be due to the use of legacy binary "node" 
npm WARN For further explanations, please read 
/usr/share/doc/nodejs/README.Debian 

我認爲這應該是polyfill問題。然後在webpack文件中添加require('string.prototype.startswith');。它仍然不起作用。

  1. 所使用的操作系統是Ubuntu的14.04 64.
  2. 項目鏈接:redux blog
+0

什麼是在這個文件/root/redux-blog/public/assets/server.js?在redux博客中沒有這樣的文件 – Molda

+0

它是服務器重新打包文件並由'npm run build'創建, – ryu

+0

您在哪裏添加了polyfill?將它添加到你的webpack文件中什麼都不做,它必須在你的應用程序中 – SimenB

回答

0

最後,我找到了原因,究其原因是低的Node.js版本。

相關問題