node.js - NodeJS deployment on Azure package problems -
when deploy nodejs application on azure, 1 node packages gets broken. error is:
error: %1 not valid win32 application. \\?\d:\home\site\wwwroot\node_modules\bcrypt\lib\binding\bcrypt_lib.node @ error (native) @ object.module._extensions..node (module.js:597:18) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.require (module.js:497:17) @ require (internal/module.js:20:19) @ object.<anonymous> (d:\home\site\wwwroot\node_modules\bcrypt\bcrypt.js:6:16) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.require (module.js:497:17) @ require (internal/module.js:20:19) @ object.<anonymous> (d:\home\site\wwwroot\models\user.model.js:3:14)
when download deployed files back, doesn't work locally anymore. have reinstall bcrypt package locally again working.
does knows why happens?
update: i've found way work around this. if manually enter "npm install bcrypt" in server works... . offcourse can't after every deployment myself... .
update: i've checked version azure installed before fix , after fix of bcrypt package , same version... . don't why happening... .
package.json
{ "name": "azurerest", "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www", "test": "node ./node_modules/mocha/bin/mocha" }, "dependencies": { "node-pre-gyp": "~0.6.x", "bcrypt": "~1.0.2", "body-parser": "~1.16.0", "chai": "^3.5.0", "cookie-parser": "~1.4.3", "cors": "^2.8.3", "debug": "~2.6.0", "ejs": "~2.5.5", "express": "~4.14.1", "jsonwebtoken": "^7.3.0", "jwt-simple": "^0.5.1", "mocha": "^3.2.0", "mongoose": "~4.9.0", "mongoose-pagination": "~1.0.0", "morgan": "~1.7.0", "passport": "^0.3.2", "passport-jwt": "^2.2.1", "serve-favicon": "~2.3.2", "supertest": "^3.0.0", "validator": "^7.1.0", "slack-node": "^0.1.8" } }
make sure have install essential component needed before using it.
node package using think
https://www.npmjs.com/package/bcrypt
check out link different os requirement before using this.
https://github.com/kelektiv/node.bcrypt.js/wiki/installation-instructions
and after that
make sure run npm install
in server, don't use node_module folder in server.
if have node_module in deployment code delete , install npm install
again. looks using node_module folder same in server .
Comments
Post a Comment