adding styled-components to project causes. Cannot find namespace 'NodeJS'

泄露秘密 提交于 2020-01-04 09:22:04

问题


Build a default react-native application, with Typescript and add styled-components, reference it in the app and attempt to compile causes the following error:

node_modules/styled-components/typings/styled-components.d.ts(116,44): error TS2503: Cannot find namespace 'NodeJS'.

Please see repo to reproduce. https://github.com/StevenTCramer/Issue1


回答1:


You will need install @types/node with npm in order to pick up the NodeJS namespace.

$ npm install --save-dev @types/node


来源:https://stackoverflow.com/questions/49495257/adding-styled-components-to-project-causes-cannot-find-namespace-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!