D:\kk\lin>npm install formidable npm http GET https://registry.npmjs.org/formidable npm http 304 https://registry.npmjs.org/formidable npm WARN engine formidable@1.0.13: wanted: {“node”:"<0.9.0"} (current: {“node”:“ v0.10.5”,“npm”:“1.2.18”}) formidable@1.0.13 node_modules\formidable
只是个警告
能用就行,警告不是错误。
我在网上下了ZIP包还是不行
var abc=require(“formidable”); 执行这句就出错
D:\kk\lin>node index.js
module.js:340 throw err; ^ Error: Cannot find module 'formidable’ at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (D:\kk\lin\index.js:4:9) at Module._compile (module.js:456:26) at Object.Module._extensions…js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)
要root权限,su一下就行了
你要将插件安装到你的项目目录底下 然后时候require(’./xxx’)访问