홈
가입
로그인
V2EX
›
问与答
vscode 写 nodejs 怎么才能自动代码补全内置的对象?
fqxufo
·
2019년 12월 14일
· 5993 조회수
2533일 지난 토픽입니다. 언급된 정보가 변경되었을 수 있습니다.
自己用 npm 添加的库,用 require 导入后,vscode 的 intellisense 可以自动代码补全。但是例如 process 或者__filename 这样的 node 全局对象,就不能自动提示了,请问有办法解决吗?
VSCode
代码
npm
proces
8 답글
•
2019-12-14 16:22:44 +08:00
Vegetable
2019년 12월 14일
1
yarn add @
types
/node
Vegetable
2019년 12월 14일
2
禁用 dom 补全的方式
https://stackoverflow.com/questions/52850309/how-to-disable-global-variable-from-lib-dom-d-ts
fqxufo
OP
2019년 12월 14일
3
@
Vegetable
必须要写 typescript 才可以吗?
Vegetable
2019년 12월 14일
4
@
fqxufo
不是,就普通 js 项目就行.
fqxufo
OP
2019년 12월 14일
5
@
Vegetable
我用 npm 安装了 @
types
/node 还是没有自动补全呀,是不是还需要怎么配置下?
Vegetable
2019년 12월 14일
1
6
@
fqxufo
那很奇怪,我就直接 npm install @
types
/node 就可以了
Buges
2019년 12월 14일 via Android
7
前端系已经算是 vscode 生态开发体验最好的了,你试试其他语言,要么就是选项太少要么就是重复,想省心还得上 IDE
fqxufo
OP
2019년 12월 14일
8
@
Vegetable
重新载入 vs code 就可以了,多谢🙏
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
2143 온라인
최고 기록 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 1467ms ·
UTC 11:48
·
PVG 19:48
·
LAX 03:48
·
JFK 06:48
♥ Do have faith in what you're doing.
❯