Search code examples
node.jsnpmvisual-studio-2017nugetazure-artifacts

Can I consume a Nuget package within a Node project?


I am working with Visual Studio 2017. I started from; Basic Node.js Express 4 Application.

I have a private Nuget in VSTS which has a .Net tool I would now like to use in the Node.js project (to perform some domain specific build-like tasks).

Is it possible to add a Nuget reference into a Node.js project (just to download the tool)?

I've seen that VSTS provides npm, but this would seem to be incompatible with my existing Nuget packages.


Solution

  • Is it possible to add a Nuget reference into a Node.js project (just to download the tool)?

    I am afraid you can not do that at this moment.

    Because Nuget does not currently support the node.js project even if you just download the tool. When you use nuget on the node.js project, we always get the error 'Project "Default" is not found.'. npm is the right solution for package management for node.js project.

    See similar issues on GitHub for some more details:

    Cannot install packages in Node.js project - Project "Default" is not found

    Nuget package manager cannot 'see' Node.JS projects

    Hope this helps.