一个脚本main.js依赖jsdom
require('jsdom')
运行使用命令行
node main.js
结果报错
Internal Contextify ERROR: Make sure Contextify is built with your
current Node version. To rebuild, go to the Contextify root folder and
run 'node-waf distclean && node-waf configure build’.node.js:201
throw e; // process.nextTick error, or ‘error’ event on first tick
^
Error: Cannot find module ‘…/build/Release/contextify’
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/opt/nodejs/lib/node_modules/jsdom/node_modules/contextify/lib/contextify.js:2:22)
at Module._compile (module.js:441:26)
at Object…js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
其他说明
服务器环境:centos5
nodejs 版本 v0.6.10
npm 版本 1.1.0-3
安装jsdom时的命令 npm install -g jsdom,contextify是安装jsdom时附带安装的
main.js 的目录下执行了 npm link jsdom