更新时间:2023-02-26 22:05:51
代替
RUN npm install --global gulp -y
使用
RUN sudo npm install --global gulp -y
您尝试将gulp
作为全局软件包从用户node
(不是超级用户)安装.
You try to install gulp
as a global package from user node
(not superuser).
或在将用户切换到节点之前安装gulp
.
Or install gulp
before switch user to node.
USER node
RUN npm install --global gulp -y
boot2docker 基于 VirtualBox .出于安全原因,Virtualbox不允许共享文件夹上的符号链接.
boot2docker is based on VirtualBox. Virtualbox does not allow symlinks on shared folders for security reasons.
要启用符号链接,必须将 VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 设置为 1 . (此处是描述如何在Vargrant上进行操作的链接: Symbolic链接和Vagrant中的同步文件夹)
To enable symlinks You must set VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME to 1. (Here is link to description how to do it on Vargrant: Symbolic links and synced folders in Vagrant)
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1
替换VM_NAME和SHARE_NAME,然后重新启动VirtualBox.
Replace VM_NAME and SHARE_NAME and restart VirtualBox.
另一种解决方案是将--no-bin-link
添加到npm
:
Another solution is add --no-bin-link
to npm
:
RUN npm install -g bower --no-bin-link
RUN npm install --global gulp -y --no-bin-link
默认情况下,Windows 7安全策略不允许创建符号链接,因为它是潜在的安全威胁.如果用户不在Administrators组中,请运行 secpol.msc 并导航至本地策略-用户权限分配,然后将您的用户添加到创建符号链接.
By default Windows 7 security policy does not allow creating symlinks as it's a potential security threat. If user is not in Administrators group run secpol.msc and navigate to Local Policies-User Rights Assignments and add your user to Create symbolic links.
如果您的用户属于Administrators组,则以以管理员身份运行开始VirtualBox
.
If your user belongs to Administrators group then start VirtualBox
with Run as Administrator.