简体   繁体   中英

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.

I also tried command yarn global add truffle but it was generating an error.

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:

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. 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

What you can do is run the command as an administrator.


For Windows (OP's Operating System)

To run the Command Prompt or PowerShell as an administrator, follow the steps below.

  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.

  3. Allow the operation by entering your password, or clicking Yes .

    通用空调

    Retrieved from a Windows virtual machine.

  4. You can now type in your commands, which will run with administrative privileges.


For 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
  3. To run all of your commands as sudo , run:

     $ sudo -s

    You can then type in your commands, which will run under the sudo privileges.

Warning: The sudo command can only be run if you have the password for it. When you run a command with sudo , it will prompt you once for the password.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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