Skip to content
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
Closed

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

k8w opened this issue Dec 8, 2016 · 4 comments
Labels

Comments

@k8w
Copy link

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
Copy link
Author

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
Copy link
Member

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
@dcodeIO dcodeIO added the bug label Dec 8, 2016
@paralin
Copy link

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
Copy link
Member

dcodeIO commented Dec 9, 2016

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

@dcodeIO dcodeIO closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants