node.js - 无法在 Windows 终端中安装 Node-Inspector
问题描述
我是 NodeJS 的新手,正在尝试在 Windows 终端上安装 Node-Inspector。我在安装时收到此错误。
PS C:\Users\rahul> npm install -g node-inspector
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated request@2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
m/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated har-validator@4.2.1: this library is no longer supported
> v8-profiler@5.7.0 preinstall C:\Users\rahul\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-profiler
> node -e 'process.exit(0)'
> v8-debug@1.0.1 preinstall C:\Users\rahul\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug
> node -e 'process.exit(0)'
npm ERR! code EEXIST
npm ERR! dest C:\Users\rahul\AppData\Roaming\npm\node-inspector.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\rahul\AppData\Roaming\npm\node_modules\node-inspector\bin\inspector.js' -> 'C:\Users\rahul\AppData\Roaming\npm\node-inspector.cmd'
npm ERR! File exists: C:\Users\rahul\AppData\Roaming\npm\node-inspector.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\rahul\AppData\Roaming\npm-cache\_logs\2020-10-02T12_36_01_288Z-debug.log
PS C:\Users\rahul> node-inspector
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'C:\Users\rahul\AppData\Roaming\npm\node_modules\node-inspector\bin\inspector.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
我也将 ubuntu 安装为 WSL。谢谢。
解决方案
尝试覆盖当前安装的版本:npm install -g node-inspector --force
推荐阅读
- android - 如何使用回收站视图创建类似于三星 One UI 的查看区域?
- python - 了解 pandas 应用循环行为
- spring-boot - 就绪探测失败,状态码:401
- .net - 如何在 WEB API 应用程序中安全地使用 .NET MQQueueManager?
- javascript - 我应该在数据库查询的哪个阶段返回结果以便能够将它们用作获取响应
- php - 使用 DOM 在 PHP 中解析 XML 文件
- javascript - WebApi 到 Angular 属性键都是小写的?
- c - 指针的值不是地址吗?
- automated-tests - 你觉得 cypress 中调用函数的用处是什么?
- file - SAS 中的文件选项