Skip to content
This repository

rebuild tries to build in the wrong directory #1872

Closed
wavded opened this Issue December 12, 2011 · 5 comments

2 participants

Marc Harter Isaac Z. Schlueter
Marc Harter

On my local machine my node-canvas module is at:

/home/wavded/Projects/adn/node_modules/canvas

On my deployment machine it is at

/var/www/adn/node_modules/canvas

After rsyncing my files to the deployment machine, and cding to the directory and running npm rebuild, it tries to build the files in /home/wavded/Projects/adn/node_modules/canvas/build, I would expect it to use /var/www/adn/node_modules/canvas/build

Isaac Z. Schlueter
Owner

That's because canvas's build script doesn't do a clean before the configure/install.

Instead of this:

  "scripts": { "preinstall": "node-waf configure build" },

It should do this:

  "scripts": { "preinstall": "node-waf clean || (exit 0); node-waf configure build" },

(Which, by the way, is the default npm action if there's a wscript and no install/preinstall script is defined, so you could just delete the scripts bit.)

Isaac Z. Schlueter isaacs closed this December 12, 2011
Isaac Z. Schlueter
Owner

As a workaround, you could exclude the build/ folder from the rsync, or delete it before running rebuild.

Marc Harter

Thanks for the quick response @isaacs, I put a case in with node-canvas as well ( LearnBoost/node-canvas#134 ) but will do your workaround for now.

Isaac Z. Schlueter
Owner

Reopening. I think maybe npm should handle this better.

Isaac Z. Schlueter isaacs reopened this December 12, 2011
Isaac Z. Schlueter isaacs referenced this issue in LearnBoost/node-canvas December 12, 2011
Open

npm rebuild issue #134

Marc Harter

yeah, just noticed pg module doesn't clean by default either, seems like it wouldn't be bad and probably desirable to have npm run a clean target first before build if it exists...

Isaac Z. Schlueter isaacs closed this in 1395630 December 12, 2011
Jonathan Stewmon jstewmon referenced this issue in caolan/async February 24, 2012
Merged

npm 1.1.1 compatibility fix #103

Paul Selden pselden referenced this issue in brianc/node-postgres September 13, 2012
Closed

Trouble building natively on Heroku #116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.