Npm 未安装 node-telegram-bot-api

问题描述

我的规格

C:\Users\new>node -v
v14.17.1

C:\Users\new>npm -v
6.14.13

C:\Users\new>py -V
Python 3.9.5

C:\Users\new>cmd
Microsoft Windows [Version 10.0.19042.1052]
(c) Microsoft Corporation. All rights reserved.

Windows 32-Bit 我用 python 创建了很多电报机器人。我想用节点创建电报机器人。我尝试安装 node-telegram-bot-api 但 npm 没有安装它。以下是这些日志:

F:\nodejs-telegram-bots\bot-1>npm i node-telegram-bot-api
npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the Now deprecated request package,see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! code UNKNowN
npm ERR! syscall open
npm ERR! path C:\Users\new\AppData\Roaming\npm-cache\_cacache\index-v5\e1\f6\4466258647476fcd56918517f073f7a7586495b3bd3f1029a99ffca77596
npm ERR! errno -4094
npm ERR! UNKNowN: unkNown error,open 'C:\Users\new\AppData\Roaming\npm-cache\_cacache\index-v5\e1\f6\4466258647476fcd56918517f073f7a7586495b3bd3f1029a99ffca77596'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\new\AppData\Roaming\npm-cache\_logs\2021-06-24T12_10_33_145Z-debug.log

我用过 npm cache clean

F:\nodejs-telegram-bots\bot-1>npm cache clean
npm ERR! As of npm@5,the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent,use 'npm cache verify' instead. On the other hand,if you're debugging an issue with the installer,you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR! 
npm ERR! If you're sure you want to delete the entire cache,rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\new\AppData\Roaming\npm-cache\_logs\2021-06-24T12_42_29_100Z-debug.log

还有npm cache clean --force

F:\nodejs-telegram-bots\bot-1>npm cache clean --force
npm WARN using --force I sure hope you kNow what you are doing.
npm ERR! code UNKNowN  
npm ERR! syscall unlink
npm ERR! path C:\Users\new\AppData\Roaming\npm-cache\_cacache\index-v5\25
npm ERR! errno -4094
npm ERR! UNKNowN: unkNown error,unlink 'C:\Users\new\AppData\Roaming\npm-cache\_cacache\index-v5\25'

解决方法

检查可用空间或权限。清理缓存也有帮助

一切都在 linux 系统上运行:

# npm i node-telegram-bot-api
npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package,see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN stackoverflow@1.0.0 No description
npm WARN stackoverflow@1.0.0 No repository field.

+ node-telegram-bot-api@0.53.0
added 98 packages from 132 contributors and audited 98 packages in 10.391s

23 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...