npm安装composer-rest-server等出现错误node-pre-gyp install --fallback-to-build --library

npm安装composer-rest-server等出现错误node-pre-gyp install --fallback-to-build --library

[email protected] install /usr/local/lib/node_modules/composer-rest-server/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Pre-built binaries not installable for [email protected] and [email protected] (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error read ECONNRESET
gyp WARN EACCES user “root” does not have permission to access the dev dir “/root/.node-gyp/8.10.0”
gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/.node-gyp”
make: Entering directory ‘/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/build’
make: *** No rule to make target ‘…/.node-gyp/8.10.0/include/node/common.gypi’, needed by ‘Makefile’. Stop.
make: Leaving directory ‘/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-34-generic
gyp ERR! command “/usr/bin/node” “/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js” “build” “–fallback-to-build” “–library=static_library” “–module=/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node” “–module_name=grpc_node” “–module_path=/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc”
gyp ERR! cwd /usr/local/lib/node_modules/composer-rest-server/node_modules/grpc
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.15.0-34-generic
node-pre-gyp ERR! command “/usr/bin/node” “/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build” “–library=static_library”
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/composer-rest-server/node_modules/grpc
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc’ (1)
/usr/local/lib
└── (empty)

参考方法

引用:https://www.cnblogs.com/coober/p/6429393.html
因为国内的网络环境原因,在下载npm包的时候经常会遇到无法正常下载的情况。国内淘宝推出了 npm 镜像,这是一个完整的 npmjs.org 镜像,同步频率为15分钟一次,保证与官方服务同步。推荐使用该镜像。使用方法如下:

输入以下命令,切换到淘宝镜像源:

npm install -g cnpm --registry=http://registry.npm.taobao.org

之后所有用到的 npm 命令都可以使用 cnpm 来代替,进行 安装就不会在报错了。
npm安装composer-rest-server等出现错误node-pre-gyp install --fallback-to-build --library_第1张图片

你可能感兴趣的:(区块链)