报错npm WARN Local package.json exists, but node_modules missing, did you mean to install?的解决办法
客户开发项目采用Vue开发,执行npm run dev命令时出现以下错误:
> mix
'mix' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
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 WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-07-07T03_20_04_511Z-debug.log
我们需要把依赖关系包更新一下才行
解决方法:npm install
运行完成之后,再次执行npm run dev
终于编译成功!
Laravel Mix v6.0.49
✔ Compiled Successfully in 1333ms
┌─────────────────────────────────────────────────────────────────────────────────────
───────────────────────────────────────────────────────────────────────────┬─────────┐
│ File │ Size
│
├─────────────────────────────────────────────────────────────────────────────────────
───────────────────────────────────────────────────────────────────────────┼─────────┤
│ /js/app.js │ 606 KiB
│
│ css/app.css │ 1 bytes
│
└─────────────────────────────────────────────────────────────────────────────────────
───────────────────────────────────────────────────────────────────────────┴─────────┘
webpack compiled successfully