To install it, you can run: npm install --save core-js/modules/es.object.proto.js

刘运浩
2023-12-01

 error  in ./node_modules/core-js/library/modules/es6.object.define-properties.js

Syntax Error: no such file or directory, open '/xxx/node_modules/core-js/library/modules/es6.object.define-properties.js'

运行项目突然报错了,从错误提示可以看到应该是core-js 导致的。

安装core-js

// 在项目根目录,删除node_modules。不会用命令的话手动删除即可
rm -rf /node_modules

//安装 core-js
cnpm i core-js --save

package.json

//package.json

"dependencies": {

    ....
    "core-js": "^3.25.3",
    "element-ui": "2.15.6",
    "reco-fetch": "^1.0.9",
    "sass": "1.32.8",
    "sass-loader": "8.0.2"

    ....
 }

再次运行,果然可以了!!!

 类似资料: