0

我的规格

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

1 回答 1

1

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

一切都在 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
于 2021-06-24T12:39:17.113 回答