laravel - 在 Laravel 8 上安装 Jetstream Livewire 基本身份验证时出错
问题描述
我正在尝试使用 Livewire 基本身份验证重新安装 Laravel 8。Basic Laravel 安装良好,但在安装 Jetstream 并运行“npm install && npm run dev”时,出现错误。
我发现这个链接表明 laravel mix 有问题:
https://laravel-mix.com/docs/5.0/installation
哪里说:
您不会在项目根目录中找到 webpack.config.js 文件。默认情况下,Laravel 遵循此 repo 中的配置文件。但是,如果您需要配置它,您可以将文件复制到项目根目录,然后相应地更新您的 package.json NPM 脚本:cp node_modules/laravel-mix/setup/webpack.config.js ./。
但我不明白我必须做什么。
用什么更新你的 package.json ?
将 webpack.config.js 文件复制到项目的根文件夹,重新运行 npm install 和 npm run dev 问题仍然存在。
服务器是Centos7。我会很感激这个问题的帮助,因为我完全被这个问题所困扰。我要去泰勒家求个解释!谢谢!
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
/home/myproyect/public_html/proyect/proyectlar/node_modules/cross-env/src/index.js:23
)
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/myproyect/public_html/proyect/proyectlar/node_modules/cross-env/src/bin/cross-env.js:3:18)
npm ERR! Linux 3.10.0-1160.6.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "development"
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/myproyect/public_html/proyect/proyectlar/npm-debug.log
npm ERR! Linux 3.10.0-1160.6.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/myproyect/public_html/proyect/proyectlar/npm-debug.log
解决方案
更新你的 npm 和 nodejs。
我遇到了同样的问题,更新后就可以了。
npm - 6.14.8 节点 - 14.15.1
推荐阅读
- c - 如何在 gcc 上施加预测公共性以执行计算重用
- python - 如何在 3D-Pandas Dataframe 中查找包含特定子列/嵌套列的列
- ios - Tableview 中的 Swift Firebase Firestore 数据
- ios - 约束 UICollectionView 高度以匹配内容的高度
- ios - 无法为多个 segue 重用自定义 StoryboardSegue 类
- node.js - npm install 后 npm start 失败
- c - 在 C 中使用管道在父子之间创建双向通信
- bash - 在while循环内我无法打印字符串
- python - Tensorflow 调整大小失败,形状正确
- android - 无法从资产文件夹中的数据库文件中读取数据