gpt4 book ai didi

node.js - 安装基于 Node.js 的服务时文件夹路径太长的问题

转载 作者:可可西里 更新时间:2023-11-01 09:50:54 25 4
gpt4 key购买 nike

下载在线 NPM 资源工作正常,安装和服务安装成功。

但是当我们用安装程序打包 Node_modules 文件夹时...在复制和解压缩离线下载的 node_modules 文件时会抛出文件夹路径太长错误。现在,当客户端机器没有互联网并且我们希望使用安装程序将其打包时,问题就来了。

我们将如何做。

文件路径太长/文件夹路径太长

最佳答案

您可以在 Windows 10 中禁用 260 个字符的 MAX_PATH 限制。

A registry key allows you to enable or disable the new long path behavior. To enable long path behavior set the registry key at HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled (Type: REG_DWORD). The key's value will be cached by the system (per process) after the first call to an affected Win32 file or directory function (list follows). The registry key will not be reloaded during the lifetime of the process. In order for all apps on the system to recognize the value of the key, a reboot might be required because some processes may have started before the key was set.

The registry key can also be controlled via Group Policy at Computer Configuration > Administrative Templates > System > Filesystem > Enable NTFS long paths.

You can also enable the new long path behavior per app via the manifest

MSDN

您还可以使用 npm dedupe 来减少文件夹深度.

关于node.js - 安装基于 Node.js 的服务时文件夹路径太长的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47431338/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com