简体   繁体   English

npm install && npm run dev 在 laravel 中不工作

[英]npm install && npm run dev isnt working in laravel

hi i just install the node.js and try to run this command in laravel 8嗨,我只是安装了 node.js 并尝试在 laravel 8 中运行这个命令

npm install && npm run dev npm 安装 && npm 运行开发

(note: i install node.js in D:) This is the complete installation (注意:我在 D: 安装 node.js)这是完整的安装

paste.ofcode.org/ZC8e7KP6v7gYrAxqHBFjpk paste.ofcode.org/ZC8e7KP6v7gYrAxqHBFjpk

but it gives this error:但它给出了这个错误:

  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

First, try to update your node.js file and then run "npm run dev" and if you again faced the same problem follow the following steps:首先,尝试更新您的 node.js 文件,然后运行“npm run dev”,如果您再次遇到同样的问题,请按照以下步骤操作:

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

In this step, it will update your laravel-mix version, it is in the package.json.在这一步中,它将更新您的 laravel-mix 版本,它位于 package.json 中。

Step6: npm install
Step7: npm run dev

After all these steps, everything is good.经过所有这些步骤,一切都很好。 I hope it solves your problem.我希望它能解决你的问题。

Install git bash for Windows and navigate to the project directory.安装适用于 Windows 的git bash并导航到项目目录。

Right-click in the folder and select git bash here .右键单击该文件夹并选择git bash here

After that, you can run之后,你可以运行

npm install && npm run dev

on your Git Bash window.在你的 Git Bash 窗口上。

(Nevermind what version of nodejs u use, cause we know that is very hard to run the new version of nodejs on windows7, so this solution for me working as well)! (不管你使用什么版本的 nodejs,因为我们知道在 windows7 上运行新版本的 nodejs 非常困难,所以这个解决方案对我来说也适用)!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM