npm install && npm run dev 在 laravel 中不起作用

时间:2021-04-24 07:14:26

标签: node.js laravel npm npm-install

嗨,我只是安装了 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
  \2021-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
  \2021-04-24T07_04_59_173Z-debug.log

1 个答案:

答案 0 :(得分:0)

首先,尝试更新您的 node.js 文件,然后运行“npm run 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

经过所有这些步骤,一切都很好。希望它能解决您的问题。

相关问题