NODE:npm ERR!无法在npm install上获取缓存统计信息

时间:2014-11-29 01:01:03

标签: node.js npm docker

我正在运行node和npm,在Docker容器中安装了nvm来运行测试。 NPM安装由具有自己的节点安装的非root用户运行。出于某种原因,我必须像这样调用节点... /home/user/.nvm/v0.10.33/bin/node和npm如/home/user/.nvm/v0.10.33/bin/npm ...这导致问题,并给了我一个“/ usr / bin / env”“节点”不存在,所以我将/home/user/.nvm/v0.10.33/bin/node符号链接到/ usr / bin / node并开始滚动再次。但现在我收到了这个奇怪的错误。

我搜索了这个错误,显然没有人见过它。

npm ERR! Could not get cache stat

这是完整的堆栈......

npm ERR! Could not get cache stat
npm ERR! Could not get cache stat
npm ERR! Linux 3.16.4-tinycore64
npm ERR! argv "node" "/home/jenkins/.nvm/v0.10.33/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.10
npm ERR! path /home/jenkins/.npm/_git-remotes/<<address_to_private_repo>>/objects/pack/tmp_pack_GKEEeR
npm ERR! code ENOENT
npm ERR! errno 34

npm ERR! enoent ENOENT, chown '/home/jenkins/.npm/_git-remotes/<<address_to_private_repo>>/objects/pack/tmp_pack_GKEEeR'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /home/jenkins/schools.vidigami.com/npm-debug.log

```

1 个答案:

答案 0 :(得分:0)

如果您的安装过程填充了内部用于标识模块目录的env变量NODE_PATH,以及用于查找可执行文件节点和npm的增强env var PATH,我认为该问题将消失。以下是此类步骤的步骤源代码安装

export NODE_PARENT=/some/desired/install/path_goes_here
export NODE_PARENT=/usr/local/bin/nodejs   # ONLY use if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/nodejs-v0.10.33 # use if you want to install as yourself

export PATH=${NODE_PARENT}/bin:${PATH}
export NODE_PATH=${NODE_PARENT}/lib/node_modules

./configure   --prefix=${NODE_PARENT}

make
make install