DamonOehlman / detect-browser

Unpack a browser type and version from the useragent string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing dev dependency? @types/node

Simon-Tang opened this issue · comments

Hello, upon building my TypeScript project with tsc, I got this error:

node_modules/detect-browser/index.d.ts:1:23 - error TS2688: Cannot find type definition file for 'node'.

1 /// <reference types="node" />
                        ~~~~

node_modules/detect-browser/index.d.ts:16:71 - error TS2503: Cannot find namespace 'NodeJS'.

16 export declare class NodeInfo implements DetectedInfo<'node', 'node', NodeJS.Platform, string> {
                                                                         ~~~~~~

node_modules/detect-browser/index.d.ts:20:18 - error TS2503: Cannot find namespace 'NodeJS'.

20     readonly os: NodeJS.Platform;
                    ~~~~~~
...

I followed https://stackoverflow.com/questions/43542710/buildcannot-find-type-definition-file-for-node and ran:

npm install @types/node --save-dev

This fixed the issue on my end. However I'm not finding other issues so I'm unsure if this is somehow just an issue on my end.