Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install does nothing - how make it work?

Tags:

npm

windows

bower

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' ]
like image 583
Lucenty Avatar asked Feb 07 '15 15:02

Lucenty


People also ask

Why npm install not working?

If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).

How force npm install?

Run npm update -g npm. Execute this command by running the command prompt as Administrator npm install -g windows-build-tools. Run npm install inside the project folder where the package. json file is located, if it doesn't work run: npm install --force.

How does npm install work?

npm install downloads a package and it's dependencies. npm install can be run with or without arguments. When run without arguments, npm install downloads dependencies defined in a package. json file and generates a node_modules folder with the installed modules.


1 Answers

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

like image 141
Lucenty Avatar answered Sep 27 '22 20:09

Lucenty