npm install && npm 运行 dev 在 laravel 中不工作

npm install && npm run dev isnt working in laravel

您好,我刚刚安装了 node.js 并尝试 运行 在 laravel 8

中执行此命令

npm install && npm run dev

(注意:我在 D: 中安装 node.js 这是完整的安装

paste.ofcode.org/ZC8e7KP6v7gYrAxqHBFjpk

但它给出了这个错误:

  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\john\AppData\Roaming\npm-cache\_logs
  21-04-24T07_04_58_823Z-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\john\AppData\Roaming\npm-cache\_logs
  21-04-24T07_04_59_173Z-debug.log

首先,尝试更新您的 node.js 文件,然后 运行“npm 运行 dev”,如果您再次遇到同样的问题,请执行以下步骤:

Step1: composer update
Step2: rm -rf node_modules
Step3: npm cache clean
Step4: npm install
Step5: npm outdated

在这一步中,它将更新您的 laravel-mix 版本,它在 package.json.

Step6: npm install
Step7: npm run dev

完成所有这些步骤后,一切都很好。希望能解决你的问题。