在流浪汉身上安装npm

在流浪汉身上安装npm,npm,vagrant,npm-install,Npm,Vagrant,Npm Install,我尝试用两种方式安装和使用npm,但只得到了错误 以正常方式安装npm: vagrant@precise64:~$ npm install npm ERR! Couldn't read dependencies. npm ERR! Error: ENOENT, no such file or directory '/home/vagrant/package.json' npm ERR! You may report this log at: npm ERR! <http://bu

我尝试用两种方式安装和使用npm,但只得到了错误

以正常方式安装npm:

vagrant@precise64:~$ npm install
npm ERR! Couldn't read dependencies.

npm ERR! Error: ENOENT, no such file or directory '/home/vagrant/package.json'
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/vagrant/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /home/vagrant
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path /home/vagrant/package.json
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory '/home/vagrant/package.json'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/vagrant/npm-debug.log
npm not ok
vagrant@precise64:~$npm安装
npm错误!无法读取依赖项。
npm错误!错误:enoint,没有这样的文件或目录“/home/vagrant/package.json”
npm错误!您可以在以下位置报告此日志:
npm错误!
npm错误!或使用
npm错误!reportbug——attach/home/vagrant/npm-debug.log npm
npm错误!
npm错误!Linux系统3.2.0-23-generic
npm错误!命令“node”“/usr/bin/npm”“install”
npm错误!cwd/家庭/流浪汉
npm错误!节点-v v0.6.12
npm错误!npm-V1.1.4
npm错误!path/home/vagrant/package.json
npm错误!代码eNONT
npm错误!消息enoint,没有这样的文件或目录“/home/vagrant/package.json”
npm错误!errno{}
npm错误!
npm错误!其他日志记录详细信息可在以下位置找到:
npm错误/home/vagrant/npm-debug.log
npm不好
正在尝试安装最新版本:

vagrant@precise64:~$ npm install -g npm@latest
npm http GET https://registry.npmjs.org/npm

npm ERR! Error: failed to fetch from registry: npm
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/vagrant/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "npm@latest"
npm ERR! cwd /home/vagrant
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: npm
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/vagrant/npm-debug.log
npm not ok
vagrant@precise64:~$npm安装-gnpm@latest
npm http GEThttps://registry.npmjs.org/npm
npm错误!错误:无法从注册表获取:npm
npm错误!在/usr/share/npm/lib/utils/npm registry client/get.js:139:12
npm错误!在cb(/usr/share/npm/lib/utils/npm registry client/request.js:31:9)
npm错误!应请求。\回调(/usr/share/npm/lib/utils/npm registry client/Request.js:136:18)
npm错误!at Request.callback(/usr/lib/nodejs/Request/main.js:119:22)
npm错误!应要求。(/usr/lib/nodejs/request/main.js:212:58)
npm错误!at Request.emit(events.js:88:20)
npm错误!在ClientRequest。(/usr/lib/nodejs/request/main.js:412:12)
npm错误!在ClientRequest.emit(events.js:67:17)
npm错误!在HTTPParser.onIncoming(http.js:1261:11)
npm错误!在HTTPParser.onHeadersComplete(http.js:102:31)
npm错误!您可以在以下位置报告此日志:
npm错误!
npm错误!或使用
npm错误!reportbug——attach/home/vagrant/npm-debug.log npm
npm错误!
npm错误!Linux系统3.2.0-23-generic
npm错误!命令“node”“/usr/bin/npm”“install”“-g”npm@latest"
npm错误!cwd/家庭/流浪汉
npm错误!节点-v v0.6.12
npm错误!npm-V1.1.4
npm错误!无法从注册表获取消息:npm
npm错误!
npm错误!其他日志记录详细信息可在以下位置找到:
npm错误/home/vagrant/npm-debug.log
npm不好

在创建此package.json文件并使其正常工作之前,我应该安装什么

npm看起来已经安装好了。转到项目根目录并执行以下操作:

npm init
它将引导您创建一个package.json文件,然后您可以

npm i whateverpackageyouwant

让您心满意足。

npm似乎已经安装好了。第一个错误是由于缺少package.json文件。你们有什么npm版本(
npm-v
)?我试过了。当我尝试安装某些东西时,我得到了相同的错误。npm http get npm ERR!错误:无法从注册表获取:bower npm ERR!在/usr/share/npm/lib/utils/npm registry client/get.js:139:12 npm ERR!在cb(/usr/share/npm/lib/utils/npm registry client/request.js:31:9)npm ERR!在请求时。\回调(/usr/share/npm/lib/utils/npm registry client/Request.js:136:18)npm ERR!at Request.callback(/usr/lib/nodejs/Request/main.js:119:22)npm ERR!应要求。/**/npm不好,你能帮我一个忙并
npm配置集注册表吗https://registry.npmjs.org/
然后
npm i grunt bower concat--将dev
保存到一个新的项目文件夹中,然后将输出放入您的问题中?首先,我粘贴了调试日志文件,然后是我在GitBash中编写的所有内容。非常感谢你的帮助。