2

Problem Description

Create a normal project with vue-cli3 and then access it with a browser
 vue create hello-world
SCRIPT1002: Syntax error

image.png

Click on the error location

 /***/ "./node_modules/sockjs-client/dist/sockjs.js":
/*!***************************************************!*\
  !*** ./node_modules/sockjs-client/dist/sockjs.js ***!
  \***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

image.png

Network Solutions

This solution doesn't work at all, and I don't know who tested it. My own test can't solve the actual problem at all.

image.png

solve it correctly

Lower the version of sockjs-client , his dependencies are described in package-lock.json in it, if this happens, your version may be above the version given below me

 npm i sockjs-client@1.5.1 -D

After the updated version is complete, recompile the project

can be solved


羊先生
1.9k 声望821 粉丝