我即将在ECS服务器上部署我的项目。它在本地计算机上运行正常,但在常规例程之后npm run build
然后npm run start
。应用程序以非常有线的错误退出。
/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');
。它仍然不起作用。
答案 0 :(得分:0)
最后,我发现原因和原因是Node.js版本较低。