0

I am using Azure to run my builds and I need to do a production NPM install. I want to install my node modules in a different folder than that which my package.json is in.

this is my command

mkdir ./tmp
npm install --production --prefix ./tmp 

If it means anything, I'm using Ubuntu 16.04 and the error I get is this

no such file or directory, open '/home/vsts/work/1/s/tmp/package.json'

Help?

Christopher Mellor
  • 440
  • 1
  • 8
  • 22
  • Check this issue which is asking the same thing https://stackoverflow.com/questions/14469515/how-to-npm-install-to-a-specified-directory – Micah_MSFT Jan 15 '19 at 21:28
  • this looks like what I'm already doing, yeah? – Christopher Mellor Jan 15 '19 at 22:03
  • You are running npm install and not just install correct? – Micah_MSFT Jan 16 '19 at 21:28
  • Micah, thanks for asking. Yes. I am running npm install. I can see why that would be confusing given the code though. I will edit it. – Christopher Mellor Jan 17 '19 at 18:53
  • I spun up a new VM and am seeing the same error. I found this https://stackoverflow.com/questions/14742553/how-to-set-custom-location-for-local-installation-of-npm-package and I tried npm install production -g --prefix ./tmp and it seemed to work. Give that a try? – Micah_MSFT Jan 17 '19 at 22:57

0 Answers0