NPM每次都下载nodejs

时间:2015-07-25 14:23:33

标签: node.js npm fedora

我使用fedora,所以我从repos安装了nodejs和npm。

但我需要安装SailsJS,它要求更新的npm版本,所以我做了sudo npm install npm -g,但之后安装每个软件包需要花费很多时间并且处于详细模式我可以看到每次nodejs都是获取和编译(即使我的fedora已经安装了相同的版本)。一些输出:

npm verb linkBins utf-8-validate@1.1.0
npm verb linkMans utf-8-validate@1.1.0
npm verb rebuildBundles utf-8-validate@1.1.0
npm verb rebuildBundles [ 'bindings', 'nan' ]
npm info install utf-8-validate@1.1.0

> utf-8-validate@1.1.0 install /lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp verb cli [ 'node',
gyp verb cli   '/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@2.0.2
gyp info using node@0.10.36 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /bin/python2
gyp verb check python version `python2 -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: v0.10.36
gyp verb command install [ 'v0.10.36' ]
gyp verb install input version string "v0.10.36"
gyp verb install installing version: 0.10.36
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.36"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate/.node-gyp"
gyp verb command install [ 'v0.10.36' ]
gyp verb install input version string "v0.10.36"
gyp verb install installing version: 0.10.36
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 0.10.36
gyp verb ensuring nodedir is created /lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate/.node-gyp/0.10.36
gyp verb created nodedir /lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate/.node-gyp
gyp http GET https://nodejs.org/dist/v0.10.36/node-v0.10.36.tar.gz
gyp http 200 https://nodejs.org/dist/v0.10.36/node-v0.10.36.tar.gz
gyp verb extracted file from tarball deps/zlib/zlib.h
gyp verb extracted file from tarball deps/zlib/deflate.h
gyp verb extracted file from tarball deps/zlib/inflate.h
gyp verb extracted file from tarball deps/zlib/zutil.h
gyp verb extracted file from tarball deps/zlib/examples/gzlog.h
gyp verb extracted file from tarball deps/zlib/crc32.h
gyp verb extracted file from tarball deps/zlib/inffast.h
gyp verb extracted file from tarball deps/zlib/trees.h
gyp verb extracted file from tarball deps/zlib/gzguts.h

1 个答案:

答案 0 :(得分:1)

您的问题似乎在此处提出了解决方案:https://github.com/TooTallNate/node-gyp/issues/610
基本上,您必须在.node-gyp目录中下载节点v0.10.36。