本文介绍了npm install什么都不做-如何使其工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用npm时遇到了麻烦,但是我还没有在Web上找到解决方案。

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

今天我想开始尝试使用nodejs,npm,bower等。

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

我使用Windows 8.1。

I use Windows 8.1.

我安装了最新的nodejs(v0.12.0)。我尝试了x64和x86构建的这些步骤。
我以管理权限打开了nodejs命令行。
我将npm更新为2.5.0版本。
运行 npm install bower -g 时,我看到一个字符,似乎在显示进度(正在滚动),但是什么也没发生。即使我让它工作了30分钟,也没有任何反应。它永远不会结束。
当我键入 np ls -g 时,它仅显示[email protected]及其依赖项。

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.

已更新

日志:

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' ]


推荐答案

找到了对我有用的解决方案。

Thetoast found solution that worked for me.

如果您遇到相同的问题,请检查TEMP环境变量的值。为此,请运行nodejs的命令窗口并输入

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%

您应该收到单个目录的路径。如果您收到多个目录(就像我一样-我收到了 C:\Users\< user> AppData\Local\Temp; c:\Users\< user> \AppData\Local\Atlassian\SourceTree\git_local\bin\ code>)表示这可能是由问题原因引起的。您可以通过键入

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>

其中<临时目录的正确路径> 可能是第一个路径(在分号之前,这表示 C:\Users\< user> \AppData\Local\Temp )。

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

这篇关于npm install什么都不做-如何使其工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 14:13