You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel 9 + Vite执行npm run build提示Mix manifest not found求助

解决Laravel 9生产环境npm run build报Mix manifest not found的问题
  • 先检查public/mix-manifest.json文件是否存在。如果执行npm run build后未生成该文件,确认webpack.mix.js配置的输出路径是否正确,基础配置示例如下:

    mix.js('resources/js/app.js', 'public/js')
       .postCss('resources/css/app.css', 'public/css');
    
  • 执行缓存清理后重新构建:

    # 清理Laravel缓存
    php artisan cache:clear
    php artisan config:clear
    # 清理npm缓存并重装依赖
    npm cache clean --force
    rm -rf node_modules package-lock.json
    npm install
    npm run build
    
  • 检查.env文件中的APP_URL配置,生产环境需设置为实际域名,避免路径解析错误:

    APP_URL=https://your-production-domain.com
    
  • 确认Laravel Mix版本与Laravel 9兼容(Laravel 9默认适配Mix v6),若版本不匹配,重新安装对应版本:

    npm install laravel-mix@^6.0.0 --save-dev
    
  • 若使用Git等版本控制工具,确认public/mix-manifest.json未被.gitignore忽略,部署时需同步该文件到生产服务器。


内容的提问来源于stack exchange,提问作者Efendy zheng

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 13:45:30