不能npm安装快递

时间:2018-03-21 07:08:19

标签: node.js npm npm-install

我无法通过npm install express安装Express。实际上,如果它尝试安装名为content-type的dev依赖项,我会收到错误。 https://www.npmjs.com/package/content-type

我尝试安装内容类型包,但它不起作用。这是错误:

60 error path C:\Users\kv\workspace\test\node_modules\content-type
61 error code ENOENT
62 error errno -4058
63 error syscall rename
64 error enoent ENOENT: no such file or directory, rename 'C:\Users\kv\workspace\test\node_modules\content-type' -> 'C:\Users\kv\workspace\test\node_modules\.content-type.DELETE'
65 error enoent This is related to npm not being able to find a file.

我使用Windows 7 64位。我已经在1周前安装过Express,效果很好。

以下是完整的日志文件:https://pastebin.com/7S4MYLed

有人知道这个问题以及如何解决这个问题?我已经尝试重新安装Node.js / npm。我还清除了缓存并重新启动了我的电脑。

2 个答案:

答案 0 :(得分:0)

删除node_module文件并再次运行npm install命令。希望这会起作用

答案 1 :(得分:0)

可能会发生这种情况,因为您的npm目录尚未初始化。 使用:

  

npm init

初始化目录。然后使用

  

npm install

安装依赖项。还要检查package.json中的依赖项。

另一种解决方法是安装express generator

相关问题