detect-browser icon indicating copy to clipboard operation
detect-browser copied to clipboard

Missing dev dependency? @types/node

Open Simon-Tang opened this issue 1 year ago • 0 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.

Simon-Tang avatar Apr 10 '23 05:04 Simon-Tang