rebuild tries to build in the wrong directory #1872

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

Projects

None yet

2 participants

@wavded
wavded commented Dec 12, 2011

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

@isaacs
Member
isaacs commented Dec 12, 2011

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.)

@isaacs isaacs closed this Dec 12, 2011
@isaacs
Member
isaacs commented Dec 12, 2011

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

@wavded
wavded commented Dec 12, 2011

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

@isaacs
Member
isaacs commented Dec 12, 2011

Reopening. I think maybe npm should handle this better.

@isaacs isaacs reopened this Dec 12, 2011
@isaacs isaacs referenced this issue in Automattic/node-canvas Dec 12, 2011
Closed

npm rebuild issue #134

@wavded
wavded commented Dec 12, 2011

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...

@isaacs isaacs added a commit that closed this issue Dec 12, 2011
@isaacs isaacs Fix #1872 Clean on rebuild 1395630
@isaacs isaacs closed this in 1395630 Dec 12, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment