0712-2888027 189-8648-0214
微信公众号

孝感风信网络科技有限公司微信公众号

当前位置:主页 > 技术支持 > PHP > Laravel The Mix manifest does not exist错误的解决

Laravel The Mix manifest does not exist错误的解决

时间:2024-05-19来源:风信官网 点击: 2473次
测试项目Laravel Shop,Git源代码到本地调整,环境配置完成之后,运行Laravel,报错信息如下:
 
The Mix manifest does not exist.
 
查看package.json文件,发现cross-env缺少了一些环境的支持
Laravel The Mix manifest does not exist错误的解决
 
至Node.js官方下载Windows LTS版本,并进行安装
 
{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "cross-env": "^5.2.0",
        "jquery": "^3.2",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.5",
        "popper.js": "^1.12",
        "vue": "^2.5.17",
        "vue-template-compiler": "^2.6.10",
        "webpack-laravel-mix-manifest": "^2.0.1"
    },
    "dependencies": {
        "@fortawesome/fontawesome-free": "^5.6.3",
        "china-area-data": "^4.0.0",
        "sweetalert": "^2.1.2"
    }
}
 
检查安装的版本信息:
 
$ node -v
v10.16.2
 
$ npm -v
6.9.0
 
然后就只需要安装 Laravel Mix。在新的 Laravel 项目中,你可以在目录结构的根目录中找到一个 package.json文件,它包括了运行基本的 Mix 所需的内容。就如同 composer.json 文件,只不过它定义的是 Node 的依赖而不是 PHP。你可以使用以下的命令安装它引用的依赖项:
 
npm install
 
如果你正在 Windows 系统上进行开发,或者在 Windows 主机系统上运行虚拟机,那你要在运行 npm install命令时使用 --no-bin-links:
 
$ npm install --no-bin-links
 
npm WARN ajv-keywords@3.4.1 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN img-loader@3.0.1 requires a peer of imagemin@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-laravel-mix-manifest@2.0.1 requires a peer of webpack@>=4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
 
audited 12750 packages in 23.651s
found 8 vulnerabilities (4 moderate, 4 high)
  run `npm audit fix` to fix them, or `npm audit` for details
 
运行 Mix
 
Mix 是位于 Webpack 顶部的配置层,所以要运行 Mix 任务,只需要执行默认的Laravel package.json 文件中包含的一个 NPM 脚本:
 
$ npm run dev
 
> @ dev D:\phpStudy\laravel-shop
> npm run development
 
 
> @ development D:\phpStudy\laravel-shop
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
 
 11% building modules 9/14 modules 5 active ...es\js\components\ExampleComponent.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
 95% emitting DONE  Compiled successfully in 7495ms9:55:10 PM
 
监控资源文件修改
 
npm run watch 会在你的终端里持续运行,监控所有相关的资源文件以便进行更改。
Webpack 会在检测到文件更改时自动重新编译资源:
 
$ npm run watch
 
在某些环境中,当文件更改时,Webpack 不会更新。如果系统出现这种情况,请考虑使用watch-poll 命令在后台运行:
 
$ npm run watch-poll &
热门关键词: Laravel Mix manifest
栏目列表
推荐内容
热点内容
展开