Skip to content

Does not support local file paths in package.json #855

New issue

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

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

Already on GitHub? # to your account

Closed
al6x opened this issue Jul 23, 2019 · 4 comments
Closed

Does not support local file paths in package.json #855

al6x opened this issue Jul 23, 2019 · 4 comments

Comments

@al6x
Copy link

al6x commented Jul 23, 2019

NPM support local file path package declaration in package.json

I specified the following dependency in my project. The VS Code can see the mypackage correctly, if you click on some function that's imported from there like mypackage/somefile - it will navigate there correctly etc.

{
  ...
  "dependencies": {
    "mypackage": "file:/myprojects/mylocalpackage"
  }
}

But when I ran it with ts-node it throw an error that it can't find mypackage/somefile package.

@blakeembrey
Copy link
Member

Can you make a reproducible example? I haven't had any issues with doing the same thing.

@al6x
Copy link
Author

al6x commented Jul 24, 2019

Sure https://github.com/alexeypetrushin/file-dependency-example

Instructions how to run in readme

$ ts-node -v
v8.3.0
$ node -v
v11.2.0

VS Code is able to understand it correctly.

@blakeembrey
Copy link
Member

I haven't been able to replicate this in 8.x:

❯ ts-node alib.ts
hello from b

However, I noticed on the latest builds (going to be v9) this will be broken and you'll be expected to use references going forward.

@cspotcode
Copy link
Collaborator

npm uses symlinks for file: dependencies. Maybe this was a symlink issue? If so, #970 should hopefully have solved any symlink issues.

I can't seem to reproduce this bug locally so I'm going to close it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants