程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Laravel 8 安装 NPM 失败大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Laravel 8 安装 NPM 失败?

开发过程中遇到Laravel 8 安装 NPM 失败的问题如何解决?下面主要结合日常开发的经验,给出你关于Laravel 8 安装 NPM 失败的解决方法建议,希望对你解决Laravel 8 安装 NPM 失败有所启发或帮助;

我想在我的 Laravel 8 项目上运行 npm run dev 命令,但出现此错误:

[webpack-cli] Error: UnkNown option '--hIDe-modules'
[webpack-cli] Run 'webpack --Help' to see available commands and options
npm ERR! code EliFECYCLE
npm ERR! errno 2
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.Js --progress --hIDe-modules --config=node_modules/laravel-mix/setup/webpa
ck.config.Js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User 1\ApPDAta\roaR_152_11845@ing\npm-cache\_logs\2021-07-03T05_59_56_150Z-deBUG.log
npm ERR! code EliFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User 1\ApPDAta\roaR_152_11845@ing\npm-cache\_logs\2021-07-03T05_59_56_264Z-deBUG.log

我的 package.Json 是这样的

{
    "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": {
        "@fortawesome/Fontawesome-free": "^5.15.1","axios": "^0.21.1","bootstrap": "^4.5.2","jquery": "^3.5.1","laravel-mix": "^4.1.4","lodash": "^4.17.20","node-sass": "^4.14.1","popper.Js": "^1.16.1","resolve-url-loader": "^2.3.1","sass": "^1.29.0","sass-loader": "^7.3.1","vue": "^2.6.12","vue-template-compiler": "^2.6.12","webpack": "^4.44.2","webpack-cli": "^4.7.2"
    },"dependencIEs": {
        "@fancyapps/fancybox": "^3.5.7","@wiris/mathtype-Tinymce5": "^7.24.1","bootstrap-fileinput": "^5.1.3","chosen-Js": "^1.8.7","copy-to-clipboard": "^3.3.1","counterup2": "^1.0.4","croppie": "^2.6.5","Font-awesome": "^4.7.0","highcharts": "^8.2.0","jquery-clock-timepicker": "^2.3.2","num2persian": "^3.2.2","production": "0.0.2","SELEct2": "^4.0.13","simplebar": "^5.3.0","slick-carousel": "^1.8.1","sweetalert2": "^8.19.0","Tinymce": "^5.5.1","tooltipster": "^4.2.8"
    }
}

我尝试删除 node_modules 文件夹并再次运行命令 npm installnpm run dev,但没有解决问题。

解决方法

至少,最新版本的 Laravel 8 对 package.json 中的脚本部分进行了更改,以利用 Laravel Mix 的更新版本。

你的 package.json 中试试这个。

{
    "private": true,"scripts": {
        "dev": "npm run development","development": "mix","watch": "mix watch","watch-poll": "mix watch -- --watch-options-poll=1000","hot": "mix watch --hot","prod": "npm run production","production": "mix --production"
    },"devDependencies": {
        "@fancyapps/fancybox": "^3.5.7","@fortawesome/fontawesome-free": "^5.15.3","@wiris/mathtype-Tinymce5": "^7.26.1","axios": "^0.21.1","bootstrap": "^5.0.2","bootstrap-fileinput": "^5.2.2","chosen-js": "^1.8.7","copy-to-clipboard": "^3.3.1","counterup2": "^1.0.4","croppie": "^2.6.5","highcharts": "^9.1.2","jquery": "^3.6.0","jquery-clock-timepicker": "^2.4.0","laravel-mix": "^6.0.25","lodash": "^4.17.21","node-sass": "^6.0.1","num2persian": "^3.2.2","popper.js": "^1.16.1","postcss-import": "^14.0.2","production": "0.0.2","resolve-url-loader": "^4.0.0","sass": "^1.35.1","sass-loader": "^12.1.0","SELEct2": "^4.0.13","simplebar": "^5.3.4","slick-carousel": "^1.8.1","sweetalert2": "^11.0.18","tailwindcss": "^2.2.4","Tinymce": "^5.8.2","tooltipster": "^4.2.8","vue": "^2.6.14","vue-template-compiler": "^2.6.14","webpack": "^5.42.0","webpack-cli": "^4.7.2"
    }
}

大佬总结

以上是大佬教程为你收集整理的Laravel 8 安装 NPM 失败全部内容,希望文章能够帮你解决Laravel 8 安装 NPM 失败所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:8失败安装