使用 Livewire 安装 Laravel Jetstream 时出现 postcss.config.js 错误

问题描述 投票:0回答:1

我正在尝试在 Laravel 项目中安装 Jetstream。运行命令 php artisan jetstream:install livewire 后立即出现此错误:

`C:\xampp\htdocs\PFE\PFE\postcss.config.js:1
export default {
SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:76:18)
    at wrapSafe (node:internal/modules/cjs/loader:1283:20)
    at Module._compile (node:internal/modules/cjs/loader:1328:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:203:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async importDefault (file:///C:/xampp/htdocs/PFE/PFE/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:36556:18)`

我将Node.js更新到最新版本(v18.20.2),但仍然出现错误。我希望 Laravel 能够正常、良好地与 Jetstream 或 Breeze 一起工作。我可以做什么来解决这个问题?

node.js laravel breeze postcss laravel-jetstream
1个回答
0
投票

请确保您的

"type" : "module"
文件中有
package.json

© www.soinside.com 2019 - 2024. All rights reserved.