New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: Cannot find type definition file for 'node' and 'long' #530

Closed
k8w opened this Issue Dec 8, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@k8w

k8w commented Dec 8, 2016

Get error even use tsd install node long when compile.

node_modules/protobufjs/types/protobuf.js.d.ts(1,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/protobufjs/types/protobuf.js.d.ts(2,1): error TS2688: Cannot find type definition file for 'long'.

@k8w

This comment has been minimized.

k8w commented Dec 8, 2016

Works well if remove this from protobuf.js.d.ts

/// <reference types="node" />
/// <reference types="long" />

And tsd install node long.

Or remove node_modules/protobufjs/types, and tsd install protobufjs node

@dcodeIO

This comment has been minimized.

Owner

dcodeIO commented Dec 8, 2016

Related: #527 (comment)

Seems that the ideal way depends on the environment. Are you aware of any documented standard on how referencing definition dependencies is supposed to be done - so it works with both DefinitelyTyped and vscode integrations?

Or remove node_modules/protobufjs/types, and tsd install protobufjs node

Are you sure that this installs v6 types? Afaik the DefinitelyTyped repository only has a definition for v5.

dcodeIO added a commit that referenced this issue Dec 8, 2016

Refactoring; Removed the need for triple-slash references in .d.ts by…
… providing a minimal Long interface, see #527, see #530

@dcodeIO dcodeIO added the bug label Dec 8, 2016

@paralin

This comment has been minimized.

paralin commented Dec 8, 2016

Easy solution.

In a post-build step, delete the two /// <reference types lines. This doesn't actually cause any problems anywhere.

We do similar in other projects with es6-promise references.

@dcodeIO

This comment has been minimized.

Owner

dcodeIO commented Dec 9, 2016

The /// reference lines aren't generated anymore, which should fix the problem.

@dcodeIO dcodeIO closed this Dec 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment