laravel 8 安装错误 - npm 运行 dev 抛出错误
laravel 8 instalation error - npm run dev throws error
我正在尝试安装一个新的 laravel 8 项目。当我尝试 运行 npm run dev
下载前端脚手架后,它给了我一个错误。在此 npm run dev
中安装 jetstream 时也会出现此问题。我在下面给出错误。
unkno@DESKTOP-NAP4DRR MINGW64 /c/laravel projects/example
$ npm run dev
> @ dev C:\laravel projects\example
> npm run development
> @ development C:\laravel projects\example
> mix
[webpack-cli] Running multiple commands at the same time is not possible
[webpack-cli] Found commands: 'bundle', 'projects\example\node_modules\laravel-mix\setup\webpack.config.js'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `mix`
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\unkno\AppData\Roaming\npm-cache\_logs21-01-09T03_39_54_620Z-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\unkno\AppData\Roaming\npm-cache\_logs21-01-09T03_39_54_704Z-debug.log
我可以看出您是 Windows 开发人员,并且您的项目文件夹名称中有空格。 Windows,spaces 和 nodejs 不喜欢一起表现得很好。
尝试从您的项目路径名称中删除空格,看看是否能解决您的问题。
更新:根据类似的问题,,这解决了用户问题。
几周前我遇到了同样的问题。我想出的是,在 windows 上,而不是 运行 宁命令 npm install && npm 运行 dev 它需要是 npm 安装和 npm 运行-dev.
还要确保安装了最新的节点和 npm 版本。同时执行 npm 审计修复以修复所有漏洞。
尝试完全重置:
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
它对我有用,在 Laravel 9
感谢先生Jeffrey Way
我正在尝试安装一个新的 laravel 8 项目。当我尝试 运行 npm run dev
下载前端脚手架后,它给了我一个错误。在此 npm run dev
中安装 jetstream 时也会出现此问题。我在下面给出错误。
unkno@DESKTOP-NAP4DRR MINGW64 /c/laravel projects/example
$ npm run dev
> @ dev C:\laravel projects\example
> npm run development
> @ development C:\laravel projects\example
> mix
[webpack-cli] Running multiple commands at the same time is not possible
[webpack-cli] Found commands: 'bundle', 'projects\example\node_modules\laravel-mix\setup\webpack.config.js'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `mix`
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\unkno\AppData\Roaming\npm-cache\_logs21-01-09T03_39_54_620Z-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\unkno\AppData\Roaming\npm-cache\_logs21-01-09T03_39_54_704Z-debug.log
我可以看出您是 Windows 开发人员,并且您的项目文件夹名称中有空格。 Windows,spaces 和 nodejs 不喜欢一起表现得很好。
尝试从您的项目路径名称中删除空格,看看是否能解决您的问题。
更新:根据类似的问题,
几周前我遇到了同样的问题。我想出的是,在 windows 上,而不是 运行 宁命令 npm install && npm 运行 dev 它需要是 npm 安装和 npm 运行-dev.
还要确保安装了最新的节点和 npm 版本。同时执行 npm 审计修复以修复所有漏洞。
尝试完全重置:
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
它对我有用,在 Laravel 9
感谢先生Jeffrey Way