-
Notifications
You must be signed in to change notification settings - Fork 357
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
Requiring JS from different locations #468
Comments
You could try linking the files. Check out the "mklink" command. Basically, it creates a pointer so two file entries can point to the same file content. |
I tried mklink with the directory option (as I need a bunch of files to be included) and then node project crashes saying "Error reading the {symlinked} directory". Even though the the folder and the symlink has enough permissions. We need to be able to link to other projects so that we can use Mocha & Node for unit testing other projects. Would that be a feature to be included in future? Thx! |
Try using npm link as well. NTVS is focused on supporting dependencies introduced as node packages, either locally or globally. You can introduce dependencies in other ways, such as Could you please provide a specific use case for requiring files in this way, so we can better understand if there is good work around? @jordimontana82 The part about "use Mocha & Node for unit testing other projects" is also a bit unclear to me. The part about mocha is being tracked in #403 I believe, but I don't understand the node part. Thanks. |
Thanks for the quick reply Matt, I was using NTVS 1.1 and Update 2, will try with the 1.2 alpha and get back to you! :) |
Hi @mjbvz I've tried with 1.2 and it is working fine. Ex: with 1.1 I couldn't reference modules in src folder from the test folder but this is ok in 1.2! Thx! |
@jordimontana82 Glad this is resolved. I'm going to go ahead and close this issue since we are more focused on the core Node experiences. Again, if you notice any bugs with the current experience or have a more focused suggestion for how we could make things better, please open a new issue. Thanks. |
Is it possible to require scripts from folders that are above the file the require is in, or even from other projects within the same solution? Node.JS can do this, but I'm looking to getting this to work in Node.JS Tools so I can have IntelliSense. For the cross-project require I tried creating a link to the file being required, but that does not seem to work. I hope anyone knows how to do this.
Thanks in advance
The text was updated successfully, but these errors were encountered: