简体   繁体   English

npm 安装总是停留在那个确切的时间

[英]npm install always stuck at that exact time

I tried running $ npm install -g truffle and $npm install but it was constantly freezing at a particular point.我尝试运行$ npm install -g truffle$npm install但它在某个特定点一直冻结。

I also tried command yarn global add truffle but it was generating an error.我也试过命令yarn global add truffle但它产生了一个错误。

I looked for answers on the inte.net one of which suggested to run npm config set registry http://registry.npmjs.org/ and then npm install , but now I'm receiving the error:我在 inte.net 上寻找答案,其中一个建议运行npm config set registry http://registry.npmjs.org/然后npm install ,但现在我收到错误:

EPERM: operation not permitted, unlink 'C:\Users\dell\AppData\Roaming\npm\node_modules\.staging'
yarn command now freezes after a point

I'm a beginner, please help.我是初学者,请帮忙。

It happens to me many times when I'm using Windows. 当我使用Windows时,它很多次发生在我身上。 What I did to make it continue after I felt that it was froze is 在我觉得它被冻结之后我做了什么让它继续下去

  1. Click the terminal. 单击终端。 Make sure you set the focus on the terminal 确保将焦点设置在终端上

  2. Hit ctrl + k 点击ctrl + k

What you can do is run the command as an administrator.您可以做的是以管理员身份运行命令。


For Windows (OP's Operating System)对于 Windows(OP 的操作系统)

To run the Command Prompt or PowerShell as an administrator, follow the steps below.要以管理员身份运行命令提示符或 PowerShell,请按照以下步骤操作。

  1. Right-click on the Start button (don't open it).右键单击“开始”按钮(不要打开它)。

  2. Select Windows PowerShell (Administrator) , or Command Prompt (Administrator) (depending on which one shows for you) in the menu. Select Windows PowerShell(管理员) ,或菜单中的命令提示符(管理员) (取决于为您显示的是哪个)。

  3. Allow the operation by entering your password, or clicking Yes .通过输入您的密码或单击允许操作。

    通用空调

    Retrieved from a Windows virtual machine.从 Windows 虚拟机中检索。

  4. You can now type in your commands, which will run with administrative privileges.您现在可以输入您的命令,这些命令将以管理权限运行。


For macOS/Linux对于 macOS/Linux

To run the command as an administrator, follow the steps below.要以管理员身份运行命令,请按照以下步骤操作。

  1. Open the Terminal application.打开终端应用程序。

  2. Run the command prefixed with sudo .运行以sudo为前缀的命令。

     $ sudo
  3. To run all of your commands as sudo , run:要以sudo运行所有命令,请运行:

     $ sudo -s

    You can then type in your commands, which will run under the sudo privileges.然后你可以输入你的命令,这些命令将在sudo权限下运行。

Warning: The sudo command can only be run if you have the password for it.警告: sudo命令只有在您有密码的情况下才能运行。 When you run a command with sudo , it will prompt you once for the password.当您使用sudo运行命令时,它会提示您一次输入密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM