简体   繁体   English

NODE:npm ERR! 在npm安装时无法获取缓存统计信息

[英]NODE: npm ERR! Could not get cache stat on npm install

I am running node and npm, installed with nvm inside a Docker container to run tests. 我正在运行节点和npm,并在Docker容器中安装了nvm来运行测试。 NPM install is being run by a non-root user who has its own node installation. NPM安装由具有自己的节点安装的非root用户运行。 For some reason I have to call node like this... /home/user/.nvm/v0.10.33/bin/node and npm like /home/user/.nvm/v0.10.33/bin/npm... This caused problems and gave me a "/usr/bin/env" "node" does not exist, so I symlinked /home/user/.nvm/v0.10.33/bin/node to /usr/bin/node and things started rolling again. 由于某种原因,我必须像这样调用节点... /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,事情开始滚动再次。 But now I'm getting this strange error. 但是现在我遇到了这个奇怪的错误。

I searched this error and apparently no one has ever seen it before. 我搜索了此错误,显然以前没有人见过。

npm ERR! Could not get cache stat

Here is the full stack... 这是完整的堆栈...

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

``` ```

I feel that issue will go away if your install process populates the env variable NODE_PATH which is used internally to identify the modules directory, as well as augment env var PATH used to find executables node and npm Below are the steps for such a source code install 我认为如果您的安装过程中填充用于内部标识模块目录的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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM