The error is:
Cannot find module 'php'
Error: Cannot find module 'php'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at new View (F:\Users\MichaelJacksonIsDead\publisherServer\node_modules\express\lib\view.js:50:49)
at EventEmitter.app.render (F:\Users\MichaelJacksonIsDead\publisherServer\node_modules\express\lib\application.js:545:12)
at ServerResponse.res.render (F:\Users\MichaelJacksonIsDead\publisherServer\node_modules\express\lib\response.js:938:7)
at F:\Users\MichaelJacksonIsDead\publisherServer\routes\index.js:12:6
at Layer.handle [as handle_request] (F:\Users\MichaelJacksonIsDead\publisherServer\node_modules\express\lib\router\layer.js:82:5)
at next (F:\Users\MichaelJacksonIsDead\publisherServer\node_modules\express\lib\router\route.js:110:13)
The Route for this page to render as php is as follows:
router.get('/index.php', function(req, res, next) {
var render = require('php-node')({bin:"F:\\xampp\php\\php.exe"});
res.render('index.php');
});
I have run a npm install -g, npm install node-php -g at both project level and level above with no success:
F:\Users\MichaelJacksonIsDead\publisherServer>npm install -g
[email protected] F:\Users\MichaelJacksonIsDead\AppData\Roaming\npm\node_mod
ules\publisherServer
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], raw-body@2.
0.2, [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], f
[email protected], [email protected], [email protected], [email protected], range-parse
[email protected], [email protected], [email protected], [email protected], [email protected], ser
[email protected], [email protected], [email protected], [email protected], on
[email protected], [email protected], [email protected], [email protected], [email protected], type-is@1.
6.2, [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])
F:\Users\MichaelJacksonIsDead\publisherServer>npm start
> [email protected] start F:\Users\MichaelJacksonIsDead\publisherServer
> node ./bin/www
GET /index.php 500 41.145 ms - 954
Does anyone have any expirence with this issue? As far as I can tell I have correctly installed it... also to make sure I added the package to my json file as follows:
"dependencies": {
"body-parser": "~1.12.4",
"cookie-parser": "~1.3.5",
"debug": "~2.2.0",
"express": "~4.12.4",
"hjs": "~0.0.6",
"less-middleware": "1.0.x",
"morgan": "~1.5.3",
"serve-favicon": "~2.2.1",
"php-node": "0.0.2"
}
Lastly I did not have enough rep to open a tag php-node for the project @ https://www.npmjs.com/package/php-node, not a issue but would of been nice to have a more speficic tag :)