1
在我的app.js中,「var cfenv = require'cfenv';」原因Node.js cfenv在本地主機上導致TypeError
path.js:8
throw new TypeError('Path must be a string. Received ' +
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.join (path.js:479:5)
at getPortsFile (/Users/user1/Dev/src/bluemix/dirt/node_modules/ports/index.js:62:15)
at Object.<anonymous> (/Users/user1/Dev/src/bluemix/dirt/node_modules/ports/index.js:13:29)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
模塊'cfenv'安裝在本地node_modules中,該應用程序在Bluemix上工作。
下面是package.json,但這些版本似乎沒有影響它。這是最近纔開始引起錯誤,但我不能追本溯源......
"dependencies": {
"express": "4.12.4",
"cfenv": "1.0.3"
},
"repository": {},
"engines": {
"node": "0.12.x"
}
本地安裝的node.js版本是什麼? –
只是爲了澄清,應該是「var cfenv = require('cfenv');」,你的圓括號缺失。 –