Nodejs + npm,在ntfs分区上安装模块 [英] Nodejs + npm, installing modules on ntfs partition

查看:70
本文介绍了Nodejs + npm,在ntfs分区上安装模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装 npm 模块时遇到问题.NodeJS 安装在运行在 Windows 主机上的 Virtual Box 上的 Ubuntu 11.10 上.我的项目文件在 NTFS 分区上(我必须与 Windows 共享它们).当我尝试安装一些 npm 模块时出现错误,并且模块未安装.我发现当 npm 尝试创建符号链接时会出现问题.

可能您无法在 NTFS 分区上创建符号链接,当我在 Linux 文件系统内部"安装模块时,一切正常.

我该如何解决这个问题?我不想手动解决依赖项:/

解决方案

从 1.2.21 版开始,npm 为 install 命令提供了一个新选项.--no-bin-links

您可以使用 if 来安装特定的节点模块

npm install express --no-bin-links

以及 package.json 安装

npm install --no-bin-links

使用此选项,我可以在 VM(Ubuntu 来宾、Windows 主机)内的共享文件夹中安装许多 npm 模块而不会出现问题

将选项添加到 npm 代码中的提交是 b4c58617039c21c106a730ae

I have a problem when installing npm modules. NodeJS is installed on Ubuntu 11.10 running on Virtual Box on Windows host. My project files are on NTFS partition (I have to share them with windows). When I try to install some npm module I get an error, and module is not installed. I've found out that problem occurs when npm tries to create symbolic links.

Probably you can not create symlinks on NTFS partition, when I'm installing module "inside" Linux file system, everything works fine.

How can I fix this? I don't want to resolve dependencies manually :/

解决方案

Since version 1.2.21, npm has a new option for the install command. --no-bin-links

You can use if for installing a specific node module

npm install express --no-bin-links

and also for a package.json install

npm install --no-bin-links

With this option I've been able to install many npm modules without problems in my shared forlder inside the VM (Ubuntu guest, Windows Host)

The commit where the option was added to the npm code is b4c58617039c21c10889a9869f8e86a23e17d3a0

这篇关于Nodejs + npm,在ntfs分区上安装模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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