npm install does nothing - how make it work?
Asked Answered
C

6

17

I have a trouble with npm and I haven't found solution in web.

Today I wanted to start my adventure with nodejs, npm, bower etc.

I use Windows 8.1.

I installed the newest nodejs (v0.12.0). I tried these steps with both x64 and x86 builds. I opened nodejs command line with administrative privileges. I updated npm to 2.5.0 version. When I run npm install bower -g I see a char that seems to show progress (it'is rolling) but nothing happens. Even if I leave it "working" for a 30 minutes, nothing happens. It never ends. When I type np ls -g it shows only [email protected] and it's dependencies.

I don't know what other info I could provide. There are no errors nor logs. Please, help.

Updated

Logs:

npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   'C:\\Users\\Lucek\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   '--verbose',
npm verb cli   'install',
npm verb cli   'bower',
npm verb cli   '-g' ]
npm info using [email protected]
npm info using [email protected]
npm verb cache add spec bower
npm verb addNamed bower@*
npm verb addNameRange registry:https://registry.npmjs.org/bower not in flight; fetching
npm verb request uri https://registry.npmjs.org/bower
npm verb request no auth needed
npm info attempt registry request try #1 at 08:43:01
npm verb request id 8d309c5e387572c0
npm verb etag "CQDT3LW680UJR78VNWVFLN8Q7"
npm http request GET https://registry.npmjs.org/bower
npm http 200 https://registry.npmjs.org/bower
npm verb get saving bower to C:\Users\Lucek\AppData\Roaming\npm-cache\registry.npmjs.org\bower\.cache.json
npm verb addNamed [email protected]
npm verb addRemoteTarball https://registry.npmjs.org/bower/-/bower-1.3.12.tgz not in flight; adding
npm verb addRemoteTarball [ 'https://registry.npmjs.org/bower/-/bower-1.3.12.tgz',
npm verb addRemoteTarball   '37de0edb3904baf90aee13384a1a379a05ee214c' ]
Colossus answered 7/2, 2015 at 15:40 Comment(5)
Try npm --verbose install bower -g and post the logsMomentum
I've attached logs. Thanks in advance!Colossus
checkout github.com/npm/npm/issues/1198Momentum
unfortunately these solutions don't workColossus
I've created an issue: github.com/npm/npm/issues/7318Colossus
C
22

Thetoast found solution that worked for me.

If you have the same problem check the value of your TEMP environment variable. To do so run nodejs' command window and type

echo %TEMP%

You should receive path to a single directory. If you receive multiple directory (as I did - I received C:\Users\<user>\AppData\Local\Temp;c:\Users\<user>\AppData\Local\Atlassian\SourceTree\git_local\bin\) it means that this might by the cause of the problem. You can fix it by typing

SET TEMP=<correct path to temporary directory>

where <correct path to temporary directory> might by the first path (before semicolon, that means C:\Users\<user>\AppData\Local\Temp in my case).

Colossus answered 22/4, 2015 at 19:9 Comment(3)
Wow that really helped me. Shame on npm that they do not show an error message when something like this happens. Thanks a lotCommensal
you can use setx instead of set to set the environment-variable permanentlyMacilroy
echo $TMPDIR for Mac usersCultured
X
1

I had some issues with the npm install bower -g aswell but try this command:

npm install bower --global

this one worked for me

Xerophthalmia answered 10/2, 2015 at 9:52 Comment(1)
have been looking for a solution and this 1 does work for me.Romie
D
1

I know this is an old question but i am adding this answer just for the record.

I was facing a similar issue i.e. rotating character with no progress in actual installation after trying to install using the following command on linux Mint 17(from http://bower.io/#install-bower):

npm install -g bower

The command which actually worked for me is:

npm install --global bower

Note: You will need root/administrative privelage to run this command. So you might wanna use sudo.

Davena answered 23/7, 2015 at 13:7 Comment(0)
H
1

I was getting the same error. But I found that this was Windows Firewall problem.

Make sure your firewall is not preventing any Incoming connections or there is no limit on TCP connections.

Homemaking answered 14/12, 2016 at 15:10 Comment(0)
S
1

Just adding another solution if it helps someone - I had this issue after cloning a repo and found blowing away node_modules worked for me.

rm -rf node_modules
Sidero answered 19/3, 2020 at 4:20 Comment(0)
C
0

For me, this problem was caused by Controlled Folder Access in Windows Virus and Thread Protection > Ransomware Protection > Controlled Folder Access.

Windows Ransomware protection

Turning this off fixed the problem.

Cadell answered 19/1, 2021 at 1:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.