2015-10-14 141 views
2

我已经安装在UbuntuNPM安装不工作

node -v v0.10.25 

npm -v gives 1.3.10 

时的NodeJS我跑

sudo npm install -g 
or sudo npm install 

it gives me following error

1523 error TypeError: Cannot read property 'latest' of undefined 1523 error at next (/usr/share/npm/lib/cache.js:687:35) 1523 error
at /usr/share/npm/lib/cache.js:675:5 1523 error at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7) 1523 error at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7 1523 error at Object.oncomplete (fs.js:107:15) 1524 error If you need help, you may report this log at:

任何想法?

它为什么给我这个错误

感谢您要安装

+0

你为什么使用这样一个旧版本的Node.js的?我建议从他们的网站上获取其源代码的最新版本(v4.2.1),在本地构建并安装它。 – ryder

+0

我正在安装在Ubuntu Live机器上。 apt-get install nodejs –

+0

我已经有本地项目运行。现在它给了我erEr ^ 错误:无法找到模块'我们在那里' –

回答

4

可以有两个问题:

  1. You might be using old versions of npm. You can update your client with

    npm install npm -g

  2. There is a chance that the package you are trying to install had been unpublished from npm :)

+0

特别是,我遇到的问题是我正在安装一个范围名称(@ flowjs/flow.js)的包。早期版本的npm不支持作用域包名。 –