小编Dan*_*any的帖子

ReferenceError:文档未仅在 Vscode 编辑器中定义

此错误不会消失!它仅在 VScode 输出控制台中显示,我在 google chrome 中运行代码,错误消失了。

ReferenceError:文档未定义

示例: https: //codepen.io/Dany2020/pen/vYLWPox

`[Running] node "c:\\index.js"
var headerText = document.getElementById("header");
                   ^
    ReferenceError: document is not defined
      at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
[Done] exited with code=1 in 0.132 seconds`
Run Code Online (Sandbox Code Playgroud)

node.js output visual-studio-code vscode-extensions

0
推荐指数
1
解决办法
1万
查看次数