【问题标题】:npm install && npm run dev isnt working in laravelnpm install && npm run dev 在 laravel 中不起作用
【发布时间】:2021-07-18 06:26:11
【问题描述】:

您好,我刚刚安装了 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

【问题讨论】:

  • 你的 Laravel 版本是多少?
  • 上面可能还有额外的日志输出。有吗?如果可以,可以分享一下吗?
  • laravel 版本:8
  • @apokryfos 这是完整的安装 paste.ofcode.org/ZC8e7KP6v7gYrAxqHBFjpk

标签: node.js laravel npm npm-install


【解决方案1】:

首先,尝试更新您的 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

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

【讨论】:

    猜你喜欢
    • 2022-01-15
    • 1970-01-01
    • 2018-05-05
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    • 1970-01-01
    • 2018-02-26
    • 1970-01-01
    相关资源
    最近更新 更多