Vite + ESBuild error: No loader is configured for ".node" files: node_modules/fsevents/fsevents.node
Add fsevents to your optimizeDeps exclude in your vite.config.js file:
optimizeDeps: { exclude: ["fsevents"] },
import {defineConfig, loadEnv} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
optimizeDeps: { exclude: ["fsevents"] },
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}
})
但有可能这个bug是这样的,并不是需要引入这个,这个会引发后续一系列其他问题.
而有可能不应该使用ide推荐你的操作,而是执行:
npm install --save-dev @types/node
然后上面的就不需要了.报错清除.
标签:node,files,No,configured,loader,fsevents From: https://www.cnblogs.com/ukzq/p/17935175.html