在Homestead内部执行NPM INSTALL时出错 [英] Error executing NPM INSTALL inside Homestead

查看:88
本文介绍了在Homestead内部执行NPM INSTALL时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在Laravel中开发一个应用程序,并且创建了一个新项目,尝试在Homestead中运行NPM INSTALL时出错.

We are developing an app in Laravel, and we created a new project, we have an error when trying to run NPM INSTALL inside Homestead.

**我们正在使用:

流浪汉2.2.9NPM 6.14.10节点12.20.0最后的宅基地版本我们尝试过:

Vagrant 2.2.9 NPM 6.14.10 Node 12.20.0 The last homestead version We tried:

删除node_modules删除composer.json.lock清理缓存用最新版本重新安装虚拟机和其他stackoverflows.但是解决方案不起作用.

Deleting node_modules Deleting composer.json.lock Cleaning cache Reinstalling the virtual machine with the last version And other stackoverflows. But the solutions dont work.

我们无法运行npm install.错误是:没有这样的文件或目录打开'home/vagrant/code/testing/node_modules/yargs/node_modules/cliui/package.json.3695679736'这与npm找不到文件有关.

And we can't run npm install. The error is: no such file or directory open 'home/vagrant/code/testing/node_modules/yargs/node_modules/cliui/package.json.3695679736' This is related to npm not being able to find a file.

你能帮我吗?

谢谢.

推荐答案

我找到了解决方案,您需要:

I found the solution, you need to:

  1. 如果您使用的是ubuntu,请在本地计算机上安装NFS( sudo apt-get install nfs-kernel-server ),并检查如何在Windows中进行操作.
  2. 在文件夹映射后
  3. 在您的 Homestead.yaml 中添加类型:"nfs"
  4. 无用重新加载--provision
  1. install NFS in your local machine (sudo apt-get install nfs-kernel-server) if u are using ubuntu, check how to do it in windows.
  2. add type: "nfs" in your Homestead.yaml after folder mapping
  3. vagrant reload --provision

就这样.尝试 npm install 现在可以正常工作!

And thats it. trying npm install now is working ok!

这篇关于在Homestead内部执行NPM INSTALL时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆