請參見下面的 '連接':找不到模塊在Windows 7
C:\Program Files\nodejs>npm -g install connect
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/finalhandler/0.1.0
npm http GET https://registry.npmjs.org/debug/1.0.4
npm http GET https://registry.npmjs.org/parseurl
npm http GET https://registry.npmjs.org/utils-merge/1.0.0
npm http GET https://registry.npmjs.org/utils-merge/1.0.0
npm http GET https://registry.npmjs.org/finalhandler/0.1.0
npm http GET https://registry.npmjs.org/parseurl
npm http GET https://registry.npmjs.org/debug/1.0.4
npm http GET https://registry.npmjs.org/utils-merge/1.0.0
npm http GET https://registry.npmjs.org/parseurl
npm http GET https://registry.npmjs.org/debug/1.0.4
npm http GET https://registry.npmjs.org/finalhandler/0.1.0
npm http GET https://registry.npmjs.org/escape-html/1.0.1
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/escape-html/1.0.1
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/escape-html/1.0.1
npm http GET https://registry.npmjs.org/ms/0.6.2
[email protected] C:\Users\u166824\AppData\Roaming\npm\node_modules\connect
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])
C:\Program Files\nodejs>
是我安裝Connect模塊的成功?我如何知道「連接」已正確安裝?
此外,當我嘗試啓動我的服務器,我收到以下錯誤:
C:\Program Files\nodejs>node server.js
module.js:340
throw err;
^
Error: Cannot find module 'connect'
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> (C:\Program Files\nodejs\server.js:1:77)
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)
而在我server.js的代碼如下:
var connect = require('connect');
connect.createServer(
connect.static("../angularjs")
).listen(5000);
任何想法,爲什麼我無法連接?謝謝!