JavaScript设置。大脑js

JavaScript设置。大脑js,javascript,brain.js,Javascript,Brain.js,我下载了VS代码,使用npm下载brain.js,找到了一个示例,但我总是在控制台中遇到这个错误 Debugger listening on ws://127.0.0.1:31661/83ca1086-743d-46cf-96bc-4bb352980d2b For help, see: https://nodejs.org/en/docs/inspector Debugger attached. /Users/user/Downloads/using-machine-learning-to-de

我下载了VS代码,使用npm下载brain.js,找到了一个示例,但我总是在控制台中遇到这个错误

Debugger listening on ws://127.0.0.1:31661/83ca1086-743d-46cf-96bc-4bb352980d2b
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
/Users/user/Downloads/using-machine-learning-to-determine-light-or-dark/js/index.js:1
(function (exports, require, module, __filename, __dirname) { const input = 
document.querySelector("input")

at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)
Waiting for the debugger to disconnect...
ReferenceError: document is not defined
index.js:1
at Object.<anonymous> (/Users/user/Downloads/using-machine-learning-to-determine-light-or-dark/js/index.js:1:77)
at Module._compile (internal/modules/cjs/loader.js:675:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)
在ws://127.0.0.1:31661/83ca1086-743d-46cf-96bc-4bb352980d2b上侦听的调试器 有关帮助,请参阅:https://nodejs.org/en/docs/inspector 调试器已附加。 /Users/user/Downloads/using machine learning判断明暗/js/index.js:1 (函数(导出、要求、模块、_文件名、_目录名){const输入= 文档查询选择器(“输入”) at Function.Module._load(内部/modules/cjs/loader.js:520:3) 位于Function.Module.runMain(internal/modules/cjs/loader.js:719:10) 启动时(内部/bootstrap/node.js:228:19) 在bootstrapNodeJSCore(internal/bootstrap/node.js:576:3) 正在等待调试器断开连接。。。 引用错误:未定义文档 index.js:1 在对象上。(/Users/user/Downloads/using machine learning to determing or dark/js/index.js:1:77) at模块编译(内部/modules/cjs/loader.js:675:14) 在Object.Module._extensions..js(internal/modules/cjs/loader.js:689:10) 在Module.load(内部/modules/cjs/loader.js:589:32) 在tryModuleLoad(内部/modules/cjs/loader.js:528:12) at Function.Module._load(内部/modules/cjs/loader.js:520:3) 位于Function.Module.runMain(internal/modules/cjs/loader.js:719:10) 启动时(内部/bootstrap/node.js:228:19) 在bootstrapNodeJSCore(internal/bootstrap/node.js:576:3)
如何解决此问题?

文档。查询选择器(“输入”)
导致未定义
文档。问题:您正在控制台中运行浏览器代码