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

How to install node_modules in a project's subfolder ? #13

Open
blandine opened this issue Nov 4, 2014 · 2 comments
Open

How to install node_modules in a project's subfolder ? #13

blandine opened this issue Nov 4, 2014 · 2 comments

Comments

@blandine
Copy link

blandine commented Nov 4, 2014

Hi,

I would like to have the node_modules installed in one of the subfolder (where the package.json file is). I know that it's quite unusual, but is there a way to do that ?

Anyway, thanks for this useful tool!

@david-driscoll
Copy link
Contributor

It might be possible, I can perhaps explore it in a week or two. Probably won't be a high priority change though.

@peterrus
Copy link

I moved mine a level up by using the following node.targets file

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Support for Incremental builds -->
  <!-- When package.json is changed, we'll install and update, then update lastrun -->
  <ItemGroup>
    <NpmJson Include="$(MSBuildProjectDirectory)\..\package.json" />
    <NpmLastRun Include="$(MSBuildProjectDirectory)\..\node_modules\npm.lastrun" />
  </ItemGroup>
  <Target Name="Npm" BeforeTargets="BeforeBuild" Inputs="@(NpmJson)" Outputs="@(NpmLastRun)">
    <NpmInstall />
    <NpmUpdate />
    <Delete Files="$(MSBuildProjectDirectory)\..\node_modules\npm.lastrun" />
    <WriteLinesToFile File="$(MSBuildProjectDirectory)\..\node_modules\npm.lastrun" Lines="" />
  </Target>
  <Target Name="NpmClean" BeforeTargets="BeforeClean">
    <Delete Files="$(MSBuildProjectDirectory)\..\node_modules\npm.lastrun" />
  </Target>
</Project>

You should be able to do something similar

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

No branches or pull requests

3 participants