1、Node.js创建项目

项目microblog创建成功,提示:cd  microblog& npm install

项目创建完成时的目录如下图所示:

Node.js log2: ERR when execute  command >npm install

 

2、Node.js错误

如题所言: ERR when execute  command >npm install

主要错误代码:ERR:unauthorized Name or password is incorrect.:jade

3、Node.js错误处理

解决方法:找到系统中安装Node.js生成的.npmrc文件

Node.js log2: ERR when execute  command >npm install

第一步:打开.npmrc文件

该文件中描述文字如下:

_auth = Ym9vbnlhOjc0MTIzNjk4Nw==
email = boonya@sina.com
registry = http://registry.npmjs.vitecho.com

[_token]
AuthSession = Ym9vbnlhOjUyNjNDNzhFOqBUPRghBop_6A8g8AW0D5k0H5eP
version = 1
expires = 1382306863408
path = /
httponly = true

第二步:删除_auth=Ym9vbnlhOjc0MTIzNjk4Nw==这一行

第三部:在项目生成目录下运行:npm  install 

命令执行正确,如下图所示:

Node.js log2: ERR when execute  command >npm install

4、Node.js安装错误验证

创建安装完成后的目录如下:

Node.js log2: ERR when execute  command >npm install

而此时在node_modules中找到了jade目录,如图:

Node.js log2: ERR when execute  command >npm install

启动服务器测试是否成功:

Node.js log2: ERR when execute  command >npm install

此时浏览器也显示通过:

Node.js log2: ERR when execute  command >npm install

注:Nodejs镜像处理参考地址:http://www.v2ex.com/t/53718

相关文章: