【问题标题】:Issue with npm install using homestead on windows在 Windows 上使用宅基地安装 npm 的问题
【发布时间】:2021-01-22 23:00:37
【问题描述】:

[编辑:已解决]

它现在可以使用 NFS 协议。
从 Homestead 目录命令 vagrant plugin install vagrant-winnfsd 为 windows 上的 vagrant 添加了 nfs 支持。
在文件夹映射部分下方的Homestead.yaml 文件行type: "nfs" 中。
vagrant reload --provision 重新启动框,一切正常。


我在使用 npm 时遇到问题。我知道还有其他安装 npm 的方法,但我试图找到以这种方式安装它的解决方案 - 使用 vagrant ssh。

Windows 10 家庭版
流浪者 2.2.10
虚拟盒子 6.1.14
家园 11.x

使用 ssh 我试图从新的项目目录中“npm install”。在安装过程中我遇到错误 -2:

npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/code/project/node_modules/webpack-dev-server/node_modules/ansi-regex/package.json.360296631'
npm ERR! enoent This is related to npm not being able to find a file.

需要明确 - npm 安装在 ubuntu 上,它是 Homestead 的一部分 - 使用虚拟盒在带有 vagrant 的 VM 上运行。

希望 some1 解决了这个问题。我发现这可能是某些 Windows 权限的问题。我以管理员身份运行所有内容,正在尝试“npm install --force”等。

谢谢。

【问题讨论】:

标签: laravel npm vagrant homestead


【解决方案1】:

由于您使用的是 vagrant ssh,请尝试
sudo npm install

【讨论】:

  • 是的,伙计。问题不在于 npm 或命令,而在于共享文件夹的 Windows 权限。
猜你喜欢
  • 2021-06-30
  • 2015-08-04
  • 2017-11-11
  • 2016-10-01
  • 2019-08-22
  • 1970-01-01
  • 1970-01-01
  • 2016-03-07
相关资源
最近更新 更多