'mix'在Laravel8新安装中不被识别为内部或外部命令

我安装了一个新的 Laravel 8 应用程序,然后我跑了……

npm install

后来我跑...

npm run dev

我收到以下错误。

'mix' 不被识别为内部或外部命令


> @ dev E:wamp64wwwLaravel8ProjectsLaravel_Livewire_JetStream_Projectsjetstream_blog
> npm run development


> @ development E:wamp64wwwLaravel8ProjectsLaravel_Livewire_JetStream_Projectsjetstream_blog
> mix

'mix' is not recognized as an internal or external command, operable
program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm
ERR! @ development: `mix` npm ERR! Exit status 1 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:UsersHPAppDataRoamingnpm-cache_logs2021-01-18T17_03_24_944Z-debug.log
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: `npm run
development` npm ERR! Exit status 1 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:UsersHPAppDataRoamingnpm-cache_logs2021-01-18T17_03_24_980Z-debug.log

回答

您可能需要安装最新版本的 Laravel Mix。

npm install laravel-mix@latest --save-dev

  • Thanks alot dear @karl Hill. I was trying from morning but not find the solution you give me exact solution again thanks

回答

当您的缓存保存以前的文件时,就会发生这种情况。清除缓存并再次安装npm

npm cache clean --force 然后: npm install npm fix audit 然后: npm run development


以上是'mix'在Laravel8新安装中不被识别为内部或外部命令的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>