nodejs - npm安装https,无法正常工作

时间:2014-12-09 10:29:45

标签: node.js https

C:\wamp\www\node-node-node>npm install https
npm ERR! 404 404 Not Found: https
npm ERR! 404
npm ERR! 404 'https' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https"
npm ERR! cwd C:\wamp\www\node-node-node
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\wamp\www\node-node-node\npm-debug.log
npm ERR! not ok code 0

我得到了这个,所以我在哪里使用错误?

1 个答案:

答案 0 :(得分:3)

Node.JS内置模块来创建http服务器和https服务器。您不必使用npm安装https,但可以直接开始使用它。 https在npm之前就已存在。

var https = require("https"); 
var app = https.createServer(); 
//Rest of the code goes here