node.js - Node, copy file from module to project -
i try create node module , make postinstall script (into package.json) copy js file current project :
fs.copy(appdir + "/schedule.js", appdir + "/../../config/schedule.js", function (err) { if (err) { console.log(err); } else { fs.chmod(appdir + "/../../config/schedule.js", 0755, function (err, succ) { console.log(err, succ); }); console.log("done write schedule.js base config"); } });
the problem file correctly copy it's lock , can't edited... chmod doesn't return error. i'm under max os x node js 0.10.33 (ide intellij)
found :) if module install :
sudo npm install mymodule
the file not editable if module install without sudo fine
npm install mymodule
Comments
Post a Comment