相关疑难解决方法(0)

重大变更:webpack < 5 默认包含 Node.js 核心模块的 polyfill

我正在尝试在 Laravel/Vue.js 应用程序中使用 Socket.io。但我在运行时遇到此错误npm run dev

Module not found: Error: Can't resolve 'path' in '/home/nicolas/LaravelProjects/Chess/node_modules/socket.io/dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
    - install 'path-browserify'
If you don't want to include a polyfill, …
Run Code Online (Sandbox Code Playgroud)

node.js laravel webpack vue.js

26
推荐指数
4
解决办法
8万
查看次数

标签 统计

laravel ×1

node.js ×1

vue.js ×1

webpack ×1