Npm install global production windows build tools зависает

node --version: v10.2.1 npm --version: 6.1.0 command: npm --add-python-to-path='true' --debug install --global windows-build-tools never get it installed, it hangs there for hours

I also thought it’s kind of a bug that installing windows-build-tools hung at the following step:

PS C:Windowssystem32> npm install --global --production windows-build-tools

> windows-build-tools@5.1.0 postinstall C:UsersuserAppDataRoamingnpmnode_moduleswindows-build-tools
> node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[============================================>] 100.0% of 20.25 MB (417.45 kB/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:Usersuser.windows-build-toolspython-2.7.15.amd64.msi.
Downloading vs_BuildTools.exe
[============================================>] 100.0% of 1.12 MB (746.57 kB/s)
Downloaded vs_BuildTools.exe. Saved to C:Usersuser.windows-build-toolsvs_BuildTools.exe.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
2019-01-02T02:08:08 : Verbose : Spawning uninstall stub
2019-01-02T02:08:08 : Verbose : [InstallerImpl]: Rpc connection was closed.
2019-01-02T02:08:08 : Verbose : [InstallerImpl]: Stream was closed
2019-01-02T02:08:08 : Verbose : [SetupUpdaterImpl]: Rpc connection was closed.
2019-01-02T02:08:08 : Verbose : [SetupUpdaterImpl]: Stream was closed
------------------- Python --------------------
Successfully installed Python 2.7

However, later I realized that vs_installerservice.exe was downloading a big chunk of data in the background. (I used Windows Resource Manager to find it out.) It’s not okay to have such a behavior for someone whose Internet connection is limited or metered. Moreover, even after the downloading finished, nothing happened anymore, so the installation process kept hanging.

I’m on Windows 10 (build 1607),

$ npm version
{ npm: '6.5.0',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.15.0',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.45',
  zlib: '1.2.11' }

If you’re having trouble installing windows-build-tools (which I had a problem with recently), you should roll back to version 4.0.0.

Run PowerShell as Administrator, and then type in the following command (assuming you have node and npm installed).

npm install --global windows-build-tools@4.0.0

This process can take some time, so please be patient.

Built-in Node.js Build Tools

There are built-in Node.js build tools, so it is recommended to use this. In fact, if you go on the npm or GitHub page of the windows-build-tools package, it will say that you should use the Node.js build tools.

To do this, go to the official Node.js download website, and download the LTS version. Then, run the installer. At a point in the installation, it will have a checkbox that says Automatically install the recommended tools. Make sure to check that!

When you install it, it will also install Chocolatey, and install the build tools like the windows-build-tools package.


Even though both of these work, it is recommended to use the Node.js built tools!

Вопрос:

Я пытаюсь использовать

npm install steam

но я получаю сообщение об ошибке

error

Я не уверен, как это исправить, и я получил это на двух разных установках модуля npm. Однако я могу установить другие модули.

Что я пробовал:
Установите все необходимые зависимости. (урса, узел-гип и т.д.)
Установите Visual C++ 2005.
Установите Visual C++ 2010.
Измените путь переменной окружения на /VC/(найден в другой теме/вопросе Qaru).
Googled, Googled & гугле.

Я также получаю сообщение об ошибке при попытке сделать:

npm install ursa

Ошибка:

error2

Лучший ответ:

Ответ №1

Я знаю, что это очень старый вопрос, но первый в моем поиске Google, и через некоторое время я получил, как это решить.

найдите node в своих окнах с помощью

$ npm install -g which

$ which node

после cd в каталог, внутри каталога cd в папку node_modulesnpm и, наконец:

$ npm install node-gyp@latest

здесь работал, ответ от > этого сайта

Ответ №2

Посмотрите инструкции по установке для node-gyp – вы не можете просто npm install node-gyp. Я вижу, вы установили Visual C++, но есть еще кое-что.

Какая у вас версия windows? Если бы я знал, что я мог бы сказать вам, какую часть инструкций по работе с узлами вы не выполняли, но посмотрите на них, и вы сможете это выяснить. Я тоже пережил немного боли за это.

Ответ №3

Он упоминается в Документации четко, как показано ниже:
https://github.com/nodejs/node-gyp#installation

Вариант 1: установите все необходимые инструменты и конфигурации с помощью Microsoft Windows-build-tools, используя npm install –global –production windows-build-tools
от повышенного PowerShell или CMD.exe(выполняется как администратор).

npm install --global --production windows-build-tools

Ответ №4

Я попробовал выше предложенное npm install --global --production windows-build-tools но обнаружил, что установка всегда зависает вечно.

Мне удалось решить проблему, установив Node.js 8 вместо Node.js 10.

Ответ №5

Просто чтобы добавить к ответу, приведенному выше, любой, кто обнаружил проблему с установщиками, работающими вечно, я обнаружил, что моей проблемой является python, я удалил обе версии 3 и версии 2.

Перезапустил команду в терминале PowerShell от имени администратора, и она была установлена почти сразу.

npm install --global --production windows-build-tools

Ответ №6

Попробовал npm install mongoose –msvs_version = 2012, если у вас установлено несколько Visual, это сработало для меня

Ответ №7

Проблемы здесь связаны с модулем npm node -gyp

Я нашел решения, предлагаемые на странице сборки для эффективного проекта.

node -gyp-страница в github

Там полностью автоматический и ручной способ.

Ответ №8

ПОЖАЛУЙСТА, СЛЕДУЙТЕ ЗА ПОТОКОМ ПРАВИЛЬНО ОКНА 10×64

  1. Powershell запускается от имени администратора
  2. npm install -g node-gyp
  3. npm install --global --production windows-build-tools

Ответ №9

Как сказал Мэтт (qaru.site/questions/61703/…), вы должны установить сборщики для окон.
Однако я сделал это через cmd и получил ошибку, хотя я администратор –

Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".

Я получил ту же ошибку через PowerShell.

Для Windows 7 административный PowerShell можно найти в разделе

Панель управления → Система и безопасность → Средства администрирования → Модули Windows PowerShell

Ответ №10

Мне удалось заставить его работать, следуя Варианту 2 в инструкциях по установке Windows на следующей странице: https://github.com/nodejs/node-gyp.

Мне пришлось закрыть текущий интерфейс командной строки и снова открыть его после выполнения установки на другой, вошедший в систему как администратор.

Ответ №11

Мне удалось решить проблему, установив Node.js 6 вместо Node.js 10

Ответ №12

Для тех, кто ответит выше, не работает, вот еще одно возможное решение, чтобы посмотреть.

Проблема: При установке пакета npm os-service я получал ниже сообщение об ошибке MSB4019: Импортированный проект “d:M icrosoft.Cpp.Default.props” не найден. Убедитесь, что путь в объявлении правильный

Даже установка инструментов сборки или VS 2015 у меня не сработала. Поэтому я попытался установить ниже непосредственно через PowerShell (как администратор)

https://chocolatey.org/packages/visualcpp-build-tools/14.0.25420.1 Команда: choco install visualcpp-build-tools –version 14.0.25420.1

После установки установите переменную среды VCTargetsPath = C:Program Files (x86)MSBuildMicrosoft.Cppv4.0v140

Тогда установка пакета работала отлично после этих.

Ответ №13

Для меня работало установить компонент “VCBuild.exe”, просто загрузите мастер, установите его и снова откройте cmd как администратор и попробуйте запустить снова. Обновленная ссылка для скачивания мастера здесь

Ответ №14

Я знаю, что это старый, у меня просто была та же проблема. я смог решить ее, запустив npm install -g node-gyp и исправив! НПМ

Ответ №15

npm install –global windows-build-tools

просто запустите эту команду через powershell (щелкните правой кнопкой мыши и запустите от имени администратора!)

работал на меня..

Ответ №16

Решение, предложенное AKID Ahmed, выполнило эту работу. Вот вариант команды

Просто cd в неисправный модуль и перестройте его. ( lwip в моем случае)

cd node_moduleslwip
node-gyp rebuild --msvs_version=2015

Если у вас есть node -gyp глобально доступный

npm install node-gyp -g

Обратите внимание, что повышенные права могут пригодиться. (Запуск от имени администратора)

Ответ №17

1) установите “Lite-сервер”, а затем попробуйте выполнить команду:
npm run lite

nicothin

При установке npm-пакетов относительно часто вижу сообщения об ошибках, связанных с node-gyp.js. Пример с установкой gulp-combine-mq: https://gist.github.com/nicothin/1353fb8d63d7ece71792 Пакет, поставленный с такими ошибками, конечно, не работает.
Я нашел инструкцию https://github.com/nodejs/node-gyp#installation но там требуется ставить Visual Studio Community 2015, а это 16 ГБ — take.ms/Xyjat, что как-то некомильфо.
Есть ли какие-то другие способы, кроме переноса рабочего процесса в виртуалку с Ubuntu?

Может, где-то можно взять уже собранный вариант этой утилиты, чтобы не убивать несколько часов времени и 16 гигов места ради элементарнейшей функции объединения медиа-конструкций в CSS?


  • Вопрос задан

    более трёх лет назад

  • 8665 просмотров

Пригласить эксперта

Win8. Мне помогло по вашей второй ссылке. А именно вот эта команда:

npm install --global --production windows-build-tools

16 Гб выкачивать не пришлось. Я правда начал устанавливать Visual C++ Build Tools (4Гб), а параллельно запустил команду. Но мне кажется достаточно одной только команды (проверил, так и есть….проверил повторно, похоже эти 4 гб он по этой команде устанавливает). «Оно» само скачало и установило Python2.7 и Visual Studio Build Tools. Затем я смог установить node-static и socket.io. А не получалось потому что кто-то из них требовал пересобрать node-gyp.

Community 2015, а это 16 ГБ

Отожмите галки вообще со всего кроме поддержки visual с++


  • Показать ещё
    Загружается…

04 февр. 2023, в 20:04

35000 руб./за проект

04 февр. 2023, в 19:43

800 руб./за проект

04 февр. 2023, в 19:05

40000 руб./за проект

Минуточку внимания

Я пытаюсь использовать

npm install steam

Но я получаю сообщение об ошибке

error

Я не уверен, как это исправить, и я получил это при двух разных установках модуля npm. Однако я могу установить другие модули.

Что я пробовал: установить все необходимые зависимости. (ursa, node-gyp и т. д.) Установите Visual C ++ 2005. Установите Visual C ++ 2010. Измените путь к переменной окружения на / VC / (найден в другом потоке / вопросе StackOverflow.

Я также получаю сообщение об ошибке:

npm install ursa

Ошибка:

error2

18 ответов

Лучший ответ

Попробуйте это в строке cmd от имени администратора

необязательная часть, если вам нужно использовать прокси:

set HTTP_PROXY=http://login:password@your-proxy-host:your-proxy-port
set HTTPS_PROXY=http://login:password@your-proxy-host:your-proxy-port

Запустите это:

npm install -g --production windows-build-tools

Нет необходимости в Visual Studio. Это то, что вам нужно.

Ссылки:

https://www.npmjs.com/package/windows-build-tools
https://github.com/felixrieseberg/windows-build-tools


676

Ahmed Ashour
26 Ноя 2019 в 18:38

Я знаю, что это очень старый вопрос, но он первый в моем поиске в Google, и через некоторое время я понял, как его решить.

Найдите узел в своих окнах с помощью:
как @ janaka-bandara предложил, вы можете использовать родной
where node
если по какой-то причине у вас его нет, вы можете установить его с помощью узла
$ npm install -g which
$ which node
после cd в каталог, внутри каталога cd в папку node_modules npm и, наконец:
$ npm install node-gyp@latest
здесь работал, ответ с этого сайта < / а>


36

Edu Ruiz
7 Май 2021 в 20:23

Посмотрите инструкции по установке node-gyp — вы не можете просто npm install node-gyp . Я вижу, вы установили Visual C ++, но это еще не все.

Какая у вас версия windows? Если бы я знал, что мог бы сказать вам, какую часть инструкций node-gyp вы не выполняли, но проверьте их, и вы сможете понять это. Я тоже пережил немного боли из-за этого.


14

hong4rc
4 Мар 2019 в 05:37

Я попробовал предложенный выше npm install --global --production windows-build-tools, но обнаружил, что установка всегда зависает.

Мне удалось решить проблему, установив Node.js 8 вместо Node.js 10.


12

Gabe Sidler
6 Июн 2018 в 10:29

Просто чтобы добавить к приведенному выше ответу, любой, кто обнаружит проблему с установщиками, которая длилась вечно, я обнаружил, что моя проблема была в python, я удалил как свои версии 3, так и версии 2.

Команда повторно выполнила команду в терминале PowerShell от имени администратора, и она установилась почти сразу.

npm install --global --production windows-build-tools 


8

hong4rc
4 Мар 2019 в 05:35

ПОЖАЛУЙСТА, СЛЕДУЙТЕ ЗА ПОТОКОМ ПРАВИЛЬНО WINDOWS 10×64

  1. Powershell запускается от имени администратора
  2. npm install -g node-gyp
  3. npm install --global --production windows-build-tools


7

user1063287
14 Июл 2019 в 08:12

У меня сработала установка компонента «VCBuild.exe», просто загрузите мастер, установите и снова откройте cmd от имени администратора и попробуйте запустить снова. Обновлена ​​ссылка для загрузки мастера здесь


5

Pedro Henrique Silva
5 Июл 2019 в 21:37

Пробовал npm install mongoose —msvs_version = 2012, если у вас установлено несколько Visual, у меня это сработало


1

AKID Ahmed
31 Мар 2015 в 19:32

Проблемы здесь связаны с модулем npm node-gyp.

Я нашел решения, предлагаемые на странице сборки для этого проекта, эффективными.

страница node-gyp на github

Есть полностью автоматический способ и ручной способ.


1

Karl Horton
23 Фев 2017 в 03:54

Как сказал Мэтт (https://stackoverflow.com/a/43323045/2767413), вы должны установить инструменты сборки для окна. Однако я сделал это через cmd и получил ошибку, хотя я администратор —

Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".

Я получил ту же ошибку через PowerShell.

Для Windows 7 административную оболочку PowerShell можно найти в разделе:

Панель управления -> Система и безопасность -> Администрирование -> Модули Windows PowerShell

Мне удалось заставить его работать, следуя Варианту 2 в инструкциях по установке Windows на следующей странице: https://github.com/nodejs/node-gyp.

Мне пришлось закрыть текущий интерфейс командной строки и снова открыть его после выполнения установки на другом, вошедшем в систему как администратор.


0

Leonard Cremer
15 Дек 2018 в 12:37

Для тех, кто выше ответ не работает, вот еще одно возможное решение.

Проблема: при установке пакета npm os-service я получал ошибку ниже MSB4019: импортированный проект «d: M icrosoft.Cpp.Default.props» не был найден. Подтвердите, что путь в объявлении правильный

У меня не работала даже установка инструментов сборки или VS 2015. Поэтому я попытался установить ниже напрямую через PowerShell (как администратор)

https://chocolatey.org/packages/visualcpp-build-tools/14.0. 25420,1 Команда: choco install visualcpp-build-tools — версия 14.0.25420.1

После установки установите переменную среды VCTargetsPath = C: Program Files (x86) MSBuild Microsoft.Cpp v4.0 v140

После этого установка пакета прошла отлично.


0

Sorabh Mendiratta
30 Май 2019 в 04:55

Я знаю, что это старый, на самом деле у меня была такая же проблема. я смог решить эту проблему, запустив npm install -g node-gyp и исправив! npm


0

Benjamin Ini
27 Сен 2019 в 14:42

Npm install —global windows-build-tools

Просто запустите эту команду через PowerShell (щелкните правой кнопкой мыши и запустите от имени администратора!)

Работал на меня ..


-1

Aniket Mukherjee
4 Фев 2019 в 17:46

1) установите «облегченный сервер» и попробуйте выполнить следующую команду:
npm run lite


-5

Er Vipin Sharma
6 Ноя 2016 в 18:19

Я попытался выполнить следующие команды, но экземпляр PowerShell завис/завис:

npm install -g node-gyp
npm install --global --production windows-build-tools 

Поэтому вместо того, чтобы запускать приложение в Windows, я перенес приложение на экземпляр виртуальной машины Ubuntu и смог без проблем запустить npm install.

Поэтому, если ни одно из вышеперечисленных решений не работает, и если вы не возражаете против работы в среде Linux, попробуйте создать виртуальную машину Linux и перенести на нее свою кодовую базу. Затем запустите npm install и посмотрите, работает ли он.


1

flyingfishcattle
25 Апр 2022 в 04:42

Столкнулся с этой проблемой при попытке установить проект VueJs. Решение, которое сработало для меня, состояло в том, чтобы заменить устаревший пакет «node-sass» на «sass».

Заменены

"node-sass": "^4.5.3",

С участием

 "sass": "",


0

azy777
15 Июл 2022 в 18:18

This is my package.json:

{
"name": "my-example-app",
"version": "0.1.0",
"dependencies": {

  "request": "*",
  "nano": "3.3.x",
  "async": "~0.2"
  }
}

Now, when I open the cmd and run npm install, the install hangs. What am I doing wrong?

Ry-'s user avatar

Ry-

215k54 gold badges454 silver badges466 bronze badges

asked Jun 1, 2013 at 14:56

user1090227's user avatar

13

I had the same problem. The reason — wrong proxy was configured and because of that npm was unable to download packages.

So your best bet is to the see the output of

$ npm install --verbose

and identify the problem. If you have never configured proxy, then possible causes can be

  • Very outdated npm version.
  • Some problem with your internet connection.
  • Permissions are not sufficient for npm to modify files.

answered May 21, 2015 at 12:13

Harshil Lodhi's user avatar

Harshil LodhiHarshil Lodhi

7,0341 gold badge32 silver badges42 bronze badges

5

I was having the same problem. I tried a

npm config set registry http://registry.npmjs.org/

to turn off https. I also tried

npm set progress=false 

to turn off the progress bar (it has been reported to slow down downloads).

The problem was with my network driver. I just needed to reboot and the lag went away.

answered Sep 7, 2016 at 17:39

Steve W's user avatar

Steve WSteve W

1,0121 gold badge9 silver badges24 bronze badges

6

You can try deleting package-lock.json and running npm install afterwards.
This worked for me.

answered Mar 9, 2019 at 14:57

imaliazhar's user avatar

imaliazharimaliazhar

6065 silver badges6 bronze badges

4

I had the same issue on macOS, after some time struggling and searching around, this answer actually solved the issue for me:

npm config rm proxy
npm config rm https-proxy
npm config set registry http://registry.npmjs.org/

answered Aug 22, 2020 at 9:24

Francesco Borzi's user avatar

Francesco BorziFrancesco Borzi

53.3k46 gold badges171 silver badges243 bronze badges

2

On MacOS, I was able to solve this by

networksetup -setv6off Wi-Fi

After installing, you can revert to the original configuration with

networksetup -setv6automatic Wi-Fi

answered Nov 6, 2021 at 20:44

cujo30227's user avatar

cujo30227cujo30227

5506 silver badges15 bronze badges

3

Updating npm helped me on Mac OS. Use the command:

sudo npm install -g npm@latest

answered Dec 20, 2020 at 2:50

user12055579's user avatar

1

I am behind a corporate proxy, so I usually use an intermediate proxy to enable NTLM authentication.

I had hangs problem with npm install when using CNTLM proxy. With NTLM-APS (a similar proxy) the hangs were gone.

answered Aug 3, 2015 at 22:00

pinei's user avatar

pineipinei

2,0851 gold badge23 silver badges25 bronze badges

2

npm cache clear --force has fixed this issue for me in the past.

Furthermore, when running npm install on an air-gapped network (by the way, I provide a description about how to do this with Verdaccio), I had an issue where the install would hang at the very end. Turning off auditing (i.e. npm set audit false) on the machine on the air-gapped network resolved this issue.

answered Feb 8, 2022 at 15:16

Caleb Koch's user avatar

Caleb KochCaleb Koch

5871 gold badge7 silver badges13 bronze badges

While your mileage may vary, running npm cache verify fixed the issue for me.

answered May 11, 2020 at 12:58

Pier-Luc Gendreau's user avatar

It was strange but I guess I was just being impatient ran -> npm install —verbose and saw there was progress but it was just really slow!!! All I needed was patience :D

answered Aug 19, 2021 at 17:44

demo7up's user avatar

demo7updemo7up

4835 silver badges25 bronze badges

When your ssh key is password protected run ssh-add. npm probably hangs somewhere asking for your password.

answered May 9, 2020 at 9:01

michael's user avatar

michaelmichael

6129 silver badges11 bronze badges

0

Incase its useful to others, the following is what worked for me:

On my machine, although npm proxy was set correctly, npm install waits forever doing something like sill extract. Re-trying npm install waits forever on the same package again and again.

After waiting for a long timeout, npm install printed an error message implying that git was trying to fetch something.

The problem vanished after configuring git proxy using the below command:

git config --global http.proxy https://proxy-server:port

Note the https in the value of http.proxy without which the configuration did not take effect. Proxy server settings (http / https / port) might vary for users; hence its worth spending a bit of time experimenting with npm and git proxy server settings.

answered Nov 12, 2018 at 5:37

Kayo's user avatar

KayoKayo

9361 gold badge7 silver badges16 bronze badges

1

With due respect to all the answers, I switched to a different network and it worked for me.

answered May 23, 2021 at 7:44

novice2ninja's user avatar

1

Surprisingly just restarting my computer and running npm install again worked for me

answered Dec 4, 2022 at 8:26

Mahmood Hussain's user avatar

This method is working for me when npm blocks in installation Package for IONIC installation and ReactNative and another package npm.

You can change temporary:

npm config set prefix C:Users[username]AppDataRoamingnpmnode_modules2

  • Change the path in environment variables. Set:

    C:Users[username]AppDataRoamingnpmnode_modules2

  • Run the command to install your package.

  • Open file explorer, copy the link:

    C:Users[username]AppDataRoamingnpmnode_modules

    ok file yourpackage.CMD created another folder Created «node_modules2» in node_modules and contain your package folder.

  • Copy your package file CMD to parent folder «npm».

  • Copy your package folder to parent folder «node_modules».

  • Now run:

    npm config set prefix C:Users[username]AppDataRoamingnpm

  • Change the path in environment variables. Set:

    C:Users[username]AppDataRoamingnpm

Now the package is working correctly with the command line.

Wyck's user avatar

Wyck

9,6566 gold badges42 silver badges55 bronze badges

answered Mar 26, 2019 at 23:11

Mohamed sami Khiari's user avatar

I’m not sure if your problem is being caused by the same reason that mine was, but I too was experiencing a hanging «npm install» and was able to fix it.

In my case, I wanted to install typescript locally in the project:

npm i typescript --save-dev

For some reason this was conflicting with a global install of typescript that I had, and the shell was just hanging forever instead of finishing or erroring…

I fixing it by first removing the globally installed typescript with the -g global flag:

npm uninstall typescript -g

After doing this the first command worked! 👍

answered Oct 12, 2019 at 19:30

Jim's user avatar

JimJim

3,5511 gold badge27 silver badges60 bronze badges

I had npm hanging on installation of electronjs on Windows 10. I reinstalled and still it was hanging. But I noticed it got installed on another desktop in the same network. So finally I found the culprit. The issue was caused by Bitdefender free edition. There was no warning by the antivirus but it was blocking it silently. Even the console was not closing once the installation starts as it kept hanging. Disable antivirus/firewall if its on Windows and make sure network is open as npm does not seem to have a proper way of communicating network blocks and will keep proceeding indefinitely.

answered May 18, 2021 at 11:40

Vinu's user avatar

VinuVinu

795 bronze badges

I’ve hit this problem a couple times.

  1. When I was on VPN, I pressed Ctrl-C and disconnected from the VPN. Then npm install worked.
  2. When I wasn’t on VPN, I pressed Ctrl-C and connected to the VPN. Then, again, npm install worked.

answered Nov 4, 2021 at 22:44

Joel Sullivan's user avatar

1

For anyone on MacOS (I’m on Mojave 10.14), the following helped me out:
https://github.com/reactioncommerce/reaction/issues/1938#issuecomment-284207213

You’d run these commands

echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536

Then try npm install once more.

answered Aug 29, 2019 at 8:11

Johan Svensson's user avatar

check your environment variables for http and https

The existing entries might be creating some issues. Try deleting those entries.

Run «npm install» again.

answered Mar 20, 2020 at 8:03

Chandni Agarwal's user avatar

I just turn off my windows firewall and it worked for me.
You can also try different versions of npm.

answered May 5, 2020 at 4:46

SUSHIL MANKAR's user avatar

Check your .npmrc file for a registry entry (which identifies a server acting as a package cache.)

For me, npm install would hang partway through, and it was because of a old / non-responsive server listed in my .npmrc file. Remove the line or comment it out:

>cat ~/.npmrc
#registry=http://oldserver:4873

(And/or check with your IT / project lead as to why it’s not working ;)

answered Aug 5, 2020 at 23:46

Jeff Ward's user avatar

Jeff WardJeff Ward

15.1k5 gold badges46 silver badges56 bronze badges

install nvm (Node Version Manager) and downgrade node version from 14 to 12 solved the issue in my case

answered Aug 25, 2020 at 9:19

idan.bel's user avatar

Uninstalling and installing node and npm worked for me. I’m using Ubuntu 20.04.1 LTS

answered Mar 2, 2021 at 13:20

john grad's user avatar

john gradjohn grad

1411 silver badge6 bronze badges

In my case npm install was hanging because it was waiting for me to input a password to my ssh key while cloning from git repository. There was no prompt and I realized this might be the case when I typed random character and nothing was echoed back. In my case I had to look at package.json file and clone locally repositories listed there. Then I updated package.json and changed paths of those git repositories to my local paths. After doing this everything else was installed without further errors.

answered Mar 9, 2021 at 18:39

Greg0ry's user avatar

Greg0ryGreg0ry

8718 silver badges25 bronze badges

On windows i suddenly had the same issue and tried all of the above, but the final solution for me was to switch off the ransomware protection which I had activated. It somehow doesn´t go well along with npm enter image description here

answered Jun 4, 2021 at 7:57

Sebs030's user avatar

Sebs030Sebs030

5362 gold badges4 silver badges19 bronze badges

I was having this error because I was running npm in a (docker) container in WSL2, and docker in WSL2 was configuring the wrong nameservers in the containers, making the container unable to resolve hosts.

To see if your container (or even your host) can resolve hosts, you can try running: curl https://github.com. In my case I received curl: (6) Could not resolve host: github.com.

The error in the docker container doesn’t happen if I don’t use the default bridge, instead I used a custom bridge and defined the container with it, in which case the resolv.conf file ends up with the correct nameserver:

$ cat /etc/resolv.conf 
nameserver 127.0.0.11
options ndots:0

The ip 127.0.0.11 corresponds to the docker DNS server, solving the problem in my case.

If you aren’t running npm in a container, your issue may still be related to some misconfigured resolv.conf file (if you are in a Linux machine, or in Windows with WSL/WSL2).

answered Dec 1, 2021 at 13:41

Lucas Basquerotto's user avatar

In case anyone else encounters this, I left the npm install to run for long enough, and then the Jest extension crashed (v4.2.1), at which point the npm install completed successfully.

The Jest configuration seems to show that a test auto-watch feature was enabled. I haven’t changed any Jest settings as far as I’m aware, so this must be out-of-the-box functionality.

answered Jan 27, 2022 at 18:22

Ciaran Gallagher's user avatar

Ciaran GallagherCiaran Gallagher

3,8338 gold badges51 silver badges97 bronze badges

This is my package.json:

{
"name": "my-example-app",
"version": "0.1.0",
"dependencies": {

  "request": "*",
  "nano": "3.3.x",
  "async": "~0.2"
  }
}

Now, when I open the cmd and run npm install, the install hangs. What am I doing wrong?

Ry-'s user avatar

Ry-

215k54 gold badges454 silver badges466 bronze badges

asked Jun 1, 2013 at 14:56

user1090227's user avatar

13

I had the same problem. The reason — wrong proxy was configured and because of that npm was unable to download packages.

So your best bet is to the see the output of

$ npm install --verbose

and identify the problem. If you have never configured proxy, then possible causes can be

  • Very outdated npm version.
  • Some problem with your internet connection.
  • Permissions are not sufficient for npm to modify files.

answered May 21, 2015 at 12:13

Harshil Lodhi's user avatar

Harshil LodhiHarshil Lodhi

7,0341 gold badge32 silver badges42 bronze badges

5

I was having the same problem. I tried a

npm config set registry http://registry.npmjs.org/

to turn off https. I also tried

npm set progress=false 

to turn off the progress bar (it has been reported to slow down downloads).

The problem was with my network driver. I just needed to reboot and the lag went away.

answered Sep 7, 2016 at 17:39

Steve W's user avatar

Steve WSteve W

1,0121 gold badge9 silver badges24 bronze badges

6

You can try deleting package-lock.json and running npm install afterwards.
This worked for me.

answered Mar 9, 2019 at 14:57

imaliazhar's user avatar

imaliazharimaliazhar

6065 silver badges6 bronze badges

4

I had the same issue on macOS, after some time struggling and searching around, this answer actually solved the issue for me:

npm config rm proxy
npm config rm https-proxy
npm config set registry http://registry.npmjs.org/

answered Aug 22, 2020 at 9:24

Francesco Borzi's user avatar

Francesco BorziFrancesco Borzi

53.3k46 gold badges171 silver badges243 bronze badges

2

On MacOS, I was able to solve this by

networksetup -setv6off Wi-Fi

After installing, you can revert to the original configuration with

networksetup -setv6automatic Wi-Fi

answered Nov 6, 2021 at 20:44

cujo30227's user avatar

cujo30227cujo30227

5506 silver badges15 bronze badges

3

Updating npm helped me on Mac OS. Use the command:

sudo npm install -g npm@latest

answered Dec 20, 2020 at 2:50

user12055579's user avatar

1

I am behind a corporate proxy, so I usually use an intermediate proxy to enable NTLM authentication.

I had hangs problem with npm install when using CNTLM proxy. With NTLM-APS (a similar proxy) the hangs were gone.

answered Aug 3, 2015 at 22:00

pinei's user avatar

pineipinei

2,0851 gold badge23 silver badges25 bronze badges

2

npm cache clear --force has fixed this issue for me in the past.

Furthermore, when running npm install on an air-gapped network (by the way, I provide a description about how to do this with Verdaccio), I had an issue where the install would hang at the very end. Turning off auditing (i.e. npm set audit false) on the machine on the air-gapped network resolved this issue.

answered Feb 8, 2022 at 15:16

Caleb Koch's user avatar

Caleb KochCaleb Koch

5871 gold badge7 silver badges13 bronze badges

While your mileage may vary, running npm cache verify fixed the issue for me.

answered May 11, 2020 at 12:58

Pier-Luc Gendreau's user avatar

It was strange but I guess I was just being impatient ran -> npm install —verbose and saw there was progress but it was just really slow!!! All I needed was patience :D

answered Aug 19, 2021 at 17:44

demo7up's user avatar

demo7updemo7up

4835 silver badges25 bronze badges

When your ssh key is password protected run ssh-add. npm probably hangs somewhere asking for your password.

answered May 9, 2020 at 9:01

michael's user avatar

michaelmichael

6129 silver badges11 bronze badges

0

Incase its useful to others, the following is what worked for me:

On my machine, although npm proxy was set correctly, npm install waits forever doing something like sill extract. Re-trying npm install waits forever on the same package again and again.

After waiting for a long timeout, npm install printed an error message implying that git was trying to fetch something.

The problem vanished after configuring git proxy using the below command:

git config --global http.proxy https://proxy-server:port

Note the https in the value of http.proxy without which the configuration did not take effect. Proxy server settings (http / https / port) might vary for users; hence its worth spending a bit of time experimenting with npm and git proxy server settings.

answered Nov 12, 2018 at 5:37

Kayo's user avatar

KayoKayo

9361 gold badge7 silver badges16 bronze badges

1

With due respect to all the answers, I switched to a different network and it worked for me.

answered May 23, 2021 at 7:44

novice2ninja's user avatar

1

Surprisingly just restarting my computer and running npm install again worked for me

answered Dec 4, 2022 at 8:26

Mahmood Hussain's user avatar

This method is working for me when npm blocks in installation Package for IONIC installation and ReactNative and another package npm.

You can change temporary:

npm config set prefix C:Users[username]AppDataRoamingnpmnode_modules2

  • Change the path in environment variables. Set:

    C:Users[username]AppDataRoamingnpmnode_modules2

  • Run the command to install your package.

  • Open file explorer, copy the link:

    C:Users[username]AppDataRoamingnpmnode_modules

    ok file yourpackage.CMD created another folder Created «node_modules2» in node_modules and contain your package folder.

  • Copy your package file CMD to parent folder «npm».

  • Copy your package folder to parent folder «node_modules».

  • Now run:

    npm config set prefix C:Users[username]AppDataRoamingnpm

  • Change the path in environment variables. Set:

    C:Users[username]AppDataRoamingnpm

Now the package is working correctly with the command line.

Wyck's user avatar

Wyck

9,6566 gold badges42 silver badges55 bronze badges

answered Mar 26, 2019 at 23:11

Mohamed sami Khiari's user avatar

I’m not sure if your problem is being caused by the same reason that mine was, but I too was experiencing a hanging «npm install» and was able to fix it.

In my case, I wanted to install typescript locally in the project:

npm i typescript --save-dev

For some reason this was conflicting with a global install of typescript that I had, and the shell was just hanging forever instead of finishing or erroring…

I fixing it by first removing the globally installed typescript with the -g global flag:

npm uninstall typescript -g

After doing this the first command worked! 👍

answered Oct 12, 2019 at 19:30

Jim's user avatar

JimJim

3,5511 gold badge27 silver badges60 bronze badges

I had npm hanging on installation of electronjs on Windows 10. I reinstalled and still it was hanging. But I noticed it got installed on another desktop in the same network. So finally I found the culprit. The issue was caused by Bitdefender free edition. There was no warning by the antivirus but it was blocking it silently. Even the console was not closing once the installation starts as it kept hanging. Disable antivirus/firewall if its on Windows and make sure network is open as npm does not seem to have a proper way of communicating network blocks and will keep proceeding indefinitely.

answered May 18, 2021 at 11:40

Vinu's user avatar

VinuVinu

795 bronze badges

I’ve hit this problem a couple times.

  1. When I was on VPN, I pressed Ctrl-C and disconnected from the VPN. Then npm install worked.
  2. When I wasn’t on VPN, I pressed Ctrl-C and connected to the VPN. Then, again, npm install worked.

answered Nov 4, 2021 at 22:44

Joel Sullivan's user avatar

1

For anyone on MacOS (I’m on Mojave 10.14), the following helped me out:
https://github.com/reactioncommerce/reaction/issues/1938#issuecomment-284207213

You’d run these commands

echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536

Then try npm install once more.

answered Aug 29, 2019 at 8:11

Johan Svensson's user avatar

check your environment variables for http and https

The existing entries might be creating some issues. Try deleting those entries.

Run «npm install» again.

answered Mar 20, 2020 at 8:03

Chandni Agarwal's user avatar

I just turn off my windows firewall and it worked for me.
You can also try different versions of npm.

answered May 5, 2020 at 4:46

SUSHIL MANKAR's user avatar

Check your .npmrc file for a registry entry (which identifies a server acting as a package cache.)

For me, npm install would hang partway through, and it was because of a old / non-responsive server listed in my .npmrc file. Remove the line or comment it out:

>cat ~/.npmrc
#registry=http://oldserver:4873

(And/or check with your IT / project lead as to why it’s not working ;)

answered Aug 5, 2020 at 23:46

Jeff Ward's user avatar

Jeff WardJeff Ward

15.1k5 gold badges46 silver badges56 bronze badges

install nvm (Node Version Manager) and downgrade node version from 14 to 12 solved the issue in my case

answered Aug 25, 2020 at 9:19

idan.bel's user avatar

Uninstalling and installing node and npm worked for me. I’m using Ubuntu 20.04.1 LTS

answered Mar 2, 2021 at 13:20

john grad's user avatar

john gradjohn grad

1411 silver badge6 bronze badges

In my case npm install was hanging because it was waiting for me to input a password to my ssh key while cloning from git repository. There was no prompt and I realized this might be the case when I typed random character and nothing was echoed back. In my case I had to look at package.json file and clone locally repositories listed there. Then I updated package.json and changed paths of those git repositories to my local paths. After doing this everything else was installed without further errors.

answered Mar 9, 2021 at 18:39

Greg0ry's user avatar

Greg0ryGreg0ry

8718 silver badges25 bronze badges

On windows i suddenly had the same issue and tried all of the above, but the final solution for me was to switch off the ransomware protection which I had activated. It somehow doesn´t go well along with npm enter image description here

answered Jun 4, 2021 at 7:57

Sebs030's user avatar

Sebs030Sebs030

5362 gold badges4 silver badges19 bronze badges

I was having this error because I was running npm in a (docker) container in WSL2, and docker in WSL2 was configuring the wrong nameservers in the containers, making the container unable to resolve hosts.

To see if your container (or even your host) can resolve hosts, you can try running: curl https://github.com. In my case I received curl: (6) Could not resolve host: github.com.

The error in the docker container doesn’t happen if I don’t use the default bridge, instead I used a custom bridge and defined the container with it, in which case the resolv.conf file ends up with the correct nameserver:

$ cat /etc/resolv.conf 
nameserver 127.0.0.11
options ndots:0

The ip 127.0.0.11 corresponds to the docker DNS server, solving the problem in my case.

If you aren’t running npm in a container, your issue may still be related to some misconfigured resolv.conf file (if you are in a Linux machine, or in Windows with WSL/WSL2).

answered Dec 1, 2021 at 13:41

Lucas Basquerotto's user avatar

In case anyone else encounters this, I left the npm install to run for long enough, and then the Jest extension crashed (v4.2.1), at which point the npm install completed successfully.

The Jest configuration seems to show that a test auto-watch feature was enabled. I haven’t changed any Jest settings as far as I’m aware, so this must be out-of-the-box functionality.

answered Jan 27, 2022 at 18:22

Ciaran Gallagher's user avatar

Ciaran GallagherCiaran Gallagher

3,8338 gold badges51 silver badges97 bronze badges

Я пытаюсь использовать

npm install steam

но я получаю сообщение об ошибке

Изображение 290

Я не уверен, как это исправить, и я получил это на двух разных установках npm install. Однако я могу установить некоторые из них.

То, что я пробовал:
Установите все необходимые зависимости. (ursa, node -gyp и т.д.)
Установите Visual С++ 2005.
Установите Visual С++ 2010.
Измените путь переменной окружения на/VC/(найденный в другом потоке/вопросе StackOverflow.
Googled, googled и googled.

Я также получаю сообщение об ошибке:

npm install ursa

Ошибка:

Изображение 291

Если кто-нибудь может мне помочь, спасибо заранее.

09 фев. 2014, в 11:04

Поделиться

Источник

14 ответов

Попробуйте это из строки cmd от имени администратора

дополнительная часть, если нужен прокси:

    set HTTP_PROXY=http://login:[email protected]:your-proxy-port
    set HTTPS_PROXY=http://login:[email protected]:your-proxy-port

запустите это:

npm install -g --production windows-build-tools

Нет необходимости в Visual Studio. Это то, что вам нужно.

Matt
30 авг. 2016, в 20:00

Поделиться

Я знаю, что это очень старый вопрос, но первый в моем поиске Google, и через некоторое время я получил, как это решить.

найдите node в своих окнах с помощью

$ npm install -g which

$ which node

после cd в каталог, внутри каталога cd в папку node_modulesnpm и, наконец:

$ npm install [email protected]

здесь работал, ответ от > этого сайта

Edu Ruiz
02 март 2015, в 22:06

Поделиться

Посмотрите инструкции по установке для node -gyp: https://github.com/TooTallNate/node-gyp — вы не можете просто npm install node-gyp. Я вижу, что вы установили Visual С++, но там больше.

Какая версия окон у вас есть? Если бы я знал, что могу сказать вам, какую часть команд node -gyp вы не делали, но проверьте их, и вы сможете понять это. Я тоже немного пострадал от этого.

B T
01 июнь 2014, в 00:01

Поделиться

Он упоминается в Документации четко, как показано ниже:
https://github.com/nodejs/node-gyp#installation

Вариант 1: установите все необходимые инструменты и конфигурации с помощью Microsoft Windows-build-tools, используя npm install —global —production windows-build-tools
от повышенного PowerShell или CMD.exe(выполняется как администратор).

npm install --global --production windows-build-tools 

nsdevaraj
10 апр. 2017, в 13:57

Поделиться

Я попробовал выше предложенное npm install --global --production windows-build-tools но обнаружил, что установка всегда зависает вечно.

Мне удалось решить проблему, установив Node.js 8 вместо Node.js 10.

Gabe Sidler
06 июнь 2018, в 09:13

Поделиться

Просто добавьте к ответу, приведенному выше, что если кто-то обнаружит проблему с установщиками, которая работает вечно, я обнаружил, что моей проблемой является python, я удалил обе версии 3 и версии 2.

Перезапустил команду в терминале powershell от имени администратора и установил ее практически сразу.

npm install —global — производство windows-build-tools

darlo
04 фев. 2018, в 16:15

Поделиться

Проблемы здесь связаны с модулем npm node -gyp

Я нашел решения, предлагаемые на странице сборки для эффективного проекта.

node -gyp-страница в github

Там полностью автоматический и ручной способ.

Karl Horton
23 фев. 2017, в 01:43

Поделиться

Попробовал npm install mongoose —msvs_version = 2012, если у вас установлено несколько Visual, это сработало для меня

AKID Ahmed
31 март 2015, в 18:14

Поделиться

npm install —global windows-build-tools

просто запустите эту команду через powershell (щелкните правой кнопкой мыши и запустите от имени администратора!).

Aniket Mukherjee
04 фев. 2019, в 16:11

Поделиться

Мне удалось решить проблему, установив Node.js 6 вместо Node.js 10

sheela
30 янв. 2019, в 22:34

Поделиться

Мне удалось заставить его работать, следуя Варианту 2 в инструкциях по установке Windows на следующей странице: https://github.com/nodejs/node-gyp.

Мне пришлось закрыть текущий интерфейс командной строки и снова открыть его после выполнения установки на другой, вошедший в систему как администратор.

Leonard Cremer
15 дек. 2018, в 11:33

Поделиться

Как сказал Мэтт (https://stackoverflow.com/questions/21658832/npm-install-error-msb3428-could-not-load-the-visual-c-component-vcbuild-ex), вы должны установить сборщики для окон.
Однако я сделал это через cmd и получил ошибку, хотя я администратор —

Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".

Я получил ту же ошибку через PowerShell.

Для Windows 7 административный PowerShell можно найти в разделе

Панель управления → Система и безопасность → Средства администрирования → Модули Windows PowerShell

o.z
01 окт. 2017, в 22:56

Поделиться

Решение, предложенное AKID Ahmed, выполнило эту работу. Вот вариант команды

Просто cd в неисправный модуль и перестройте его. ( lwip в моем случае)

cd node_moduleslwip
node-gyp rebuild --msvs_version=2015

Если у вас есть node -gyp глобально доступный

npm install node-gyp -g

Обратите внимание, что повышенные права могут пригодиться. (Запуск от имени администратора)

Qwerty
07 нояб. 2016, в 16:25

Поделиться

1) установите «Lite-сервер», а затем попробуйте выполнить команду:
npm run lite

Er Vipin Sharma
06 нояб. 2016, в 15:22

Поделиться

Ещё вопросы

  • 0Как вывести положенные параметры функции mysql в платформу Codeigniter?
  • 1Переключение активности не будет поддерживать состояние представления даже при использовании saveinstancestate (), почему?
  • 1Хороший способ оценить производительность приложений на устройствах Android
  • 0Приложение, которое подключается к узлу REST API, блокируется клиентским брандмауэром
  • 1Как сделать так, чтобы ListItem Textview работал в твиттере Twitter и получал разные клики Linkify?
  • 1Речь к тексту происходит на устройстве?
  • 0Spring @Transactional не работает для вызова функции mysql
  • 0установить фоновое изображение из выпадающего меню — JavaScript
  • 1Как бы я динамически удалить компонент свинга из JPanel
  • 1Файл свойств не обновляется
  • 0Контроллер возвращает значение несколько раз
  • 0Доступ к данным массива в объекте
  • 1реагировать на естественное прохождение
  • 0Определение размера ядра (c ++ opencv)
  • 0Выбор элементов по содержанию текста в jQuery
  • 0Отправить выбранные элементы в поле?
  • 0ошибка MSB4057: цель «PreLinkEvent» не существует в проекте
  • 1Переопределить метод внешнего объекта
  • 0разобрать php код как html используя htaccess
  • 1Сортировка ArrayList <String> с пользовательским компаратором
  • 1Appwidget: есть ли способы проверить, отображается ли Appwidget в настоящее время на главном экране?
  • 0Пытаетесь написать чисто виртуальный метод, но у меня, видимо, неправильный синтаксис?
  • 0Как установить минимальную высоту синкфузионной сетки, используя Angular JS?
  • 0JQuery экранная клавиатура по запросу
  • 0Пользовательский фильтр для списка
  • 0HTML CSS 100-процентная проблема высоты — пример панели JQuery Mobile
  • 0Сравнение объектов jQuery
  • 0PHP и SQL запрос нескольких / условных фильтров
  • 0. $ ( «# ID») HTML (вар); не печатает значение. Почему?
  • 1RabbitMQ повторно обрабатывает очередь рассылки сообщений
  • 0вопросы по шаблонным признакам (связанные с числовыми вычислениями по двойному и комплексному числу)
  • 0Динамическая загрузка меню в jsp
  • 1Как заменить функцию в Python?
  • 0Где разместить запросы Doctrine, использующие несколько сущностей в Symfony2?
  • 0Python или Html живой поток с камеры?
  • 1Android OutOfMemoryError: размер растрового изображения превышает бюджет виртуальной машины
  • 1Сборка Microsoft.Phone отсутствует в проекте приложения для Windows Phone 8
  • 1Расчет среднеквадратичной ошибки тензорного потока отличается от склеарна
  • 1проверка верна моя строка в произвольном формате? количество скобок
  • 0Получение щелчка, чтобы открыть всплывающее окно из переменной js
  • 1вставьте n в каждое пространство для нескольких строк Python
  • 1Слияние фреймов данных на основе списков номеров строк
  • 1Значение приращения из выражения
  • 0PHP / MySQL, обнаруживающий изменение ценового столбца в таблице
  • 1как получить экземпляр запущенной активности
  • 0Как правильно передать переменную PHP в FPDF?
  • 0$ rootcope часы не работают в течение очень короткого времени
  • 1Ошибка TypeE на pickle.load с классом, производным от SimpleNamespace
  • 1Прерывание в потоке Java
  • 1Проверьте вход микрофона

Сообщество Overcoder

Понравилась статья? Поделить с друзьями:
  • Npm install g jshint windows как установить
  • Npfs sys синий экран windows 10
  • Npf sys windows 10 как удалить
  • Nperf speed test скачать для windows 10 бесплатно
  • Npcap скачать для windows 7 x64