在Laravel 8新安装中,“mix”未被识别为内部或外部命令

uelo1irk  于 2023-01-14  发布在  其他
关注(0)|答案(6)|浏览(154)

我已经安装了一个新的Laravel 8应用程序,然后我运行...

npm install

后来,我跑了...

npm run dev

我得到以下错误。
“mix”未被识别为内部或外部命令

> @ dev E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> npm run development

> @ development E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_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:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-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:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-01-18T17_03_24_980Z-debug.log
bmp9r5qi

bmp9r5qi1#

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

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

rhfm7lfc2#

    • 当您的缓存保存以前的文件时会发生这种情况。请清除缓存并重新安装npm**
npm cache clean --force

然后:

npm install

npm fix audit

然后:

npm run development
krcsximq

krcsximq3#

我的问题已通过以下步骤解决

npm install --g laravel-mix

npm install --g webpack-cli
ryhaxcpt

ryhaxcpt4#

NPM安装它将修复它它之所以会发生,是因为您在以前的NMP I之后安装了一些东西

因此,在任何奇怪的情况下-再次安装NPM)

kgsdhlau

kgsdhlau5#

package.json要求您运行mix-watch命令,但它不起作用
一个简单的修复,为我工作是运行npm运行手表,它为我工作laravel 8项目

klh5stk1

klh5stk16#

如果您是Windows用户,请尝试以下操作:

C:\Users{{your-username}}\AppData\Roaming\npm-cache

然后:

npm cache verify

相关问题