Raf*_*ues 5 node.js npm amp-html node-pre-gyp
我尝试安装和运行amp-paywall-demoAmpProject GitHub 存储库中提供的示例失败:https://github.com/ampproject/samples/tree/master/amp-paywall-demo \n我已经在那里提出了问题票,但没有收到任何回复到目前为止(https://github.com/ampproject/samples/issues/211)
我尝试遵循安装指南:我克隆了存储库(这按预期工作),但npm install不幸的是失败了。
我尝试自己调试该错误,但无法做到这一点。 \n我还用 google 搜索了该错误,并在 Git 存储库中的问题中搜索了类似的问题,但这也没有帮助。
\n\n我使用错误的输出以及 debug.log 文件创建了公共要点
\n\n\n\n调试:https://gist.github.com/rafaelmarques7/707f1932f63cd042cdf1e6952c1093ab
\n\n错误堆栈如下:
\n\n\xe2\x9e\x9c amp-paywall-demo git:(master) \xe2\x9c\x97 sudo npm i\n\n> grpc@0.14.1 install /home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcl\noud/node_modules/grpc\n> node-pre-gyp install --fallback-to-build\n\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp verb cli [ \'/usr/bin/node\',\nnode-pre-gyp verb cli \'/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/\ngcloud/node_modules/grpc/node_modules/.bin/node-pre-gyp\',\nnode-pre-gyp verb cli \'install\',\nnode-pre-gyp verb cli \'--fallback-to-build\' ]\nnode-pre-gyp info using node-pre-gyp@0.6.28\nnode-pre-gyp info using node@10.15.1 | linux | x64\nnode-pre-gyp verb command install []\nnode-pre-gyp info check checked for "/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/n\node_modules/gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node" (not found)\nnode-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v0.14.1/no\nde-v64-linux-x64.tar.gz\nnode-pre-gyp http 403 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v0.14.1/no\nde-v64-linux-x64.tar.gz\nnode-pre-gyp ERR! Tried to download: https://storage.googleapis.com/grpc-precompiled-binaries/node/\ngrpc/v0.14.1/node-v64-linux-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for grpc@0.14.1 and node@10.15.1 (node-v64 ABI) (fal\nling back to source compile with node-gyp) \nnode-pre-gyp http 403 status code downloading tarball https://storage.googleapis.com/grpc-precompil\ned-binaries/node/grpc/v0.14.1/node-v64-linux-x64.tar.gz \nnode-pre-gyp verb command build [ \'rebuild\' ]\nnode-pre-gyp ERR! Tried to download: https://storage.googleapis.com/grpc-precompiled-binaries/node/\ngrpc/v0.14.1/node-v64-linux-x64.tar.gz \nnode-pre-gyp ERR! Pre-built binaries not found for grpc@0.14.1 and node@10.15.1 (node-v64 ABI) (fal\nling back to source compile with node-gyp) \nnode-pre-gyp http Connection closed while downloading tarball file \nnode-pre-gyp verb command build [ \'rebuild\' ]\ngyp ERR! configure error \ngyp ERR! stack Error: EACCES: permission denied, mkdir \'/home/rafael/proj/tuts/amp-publisher-sample\n/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/build\'\ngyp ERR! System Linux 4.15.0-45-generic\ngyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary"\ngyp ERR! cwd /home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc\ngyp ERR! node -v v10.15.1\ngyp ERR! node-gyp -v v3.8.0\ngyp ERR! not ok \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute \'/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary\' (1)\nnode-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)\nnode-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)\nnode-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)\nnode-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)\nnode-pre-gyp ERR! System Linux 4.15.0-45-generic\nnode-pre-gyp ERR! command "/usr/bin/node" "/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"\nnode-pre-gyp ERR! cwd /home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc\nnode-pre-gyp ERR! node -v v10.15.1\nnode-pre-gyp ERR! node-pre-gyp -v v0.6.28\nnode-pre-gyp ERR! not ok \nFailed to execute \'/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary\' (1)\ngyp ERR! configure error \ngyp ERR! stack Error: EACCES: permission denied, mkdir \'/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/build\'\ngyp ERR! System Linux 4.15.0-45-generic\ngyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc/src/node/extension_binary"\ngyp ERR! cwd /home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcloud/node_modules/grpc\ngyp ERR! node -v v10.15.1\ngyp ERR! node-gyp -v v3.8.0\ngyp ERR! not ok \nnpm WARN amp-publisher@0.0.1 No repository field.\n\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! grpc@0.14.1 install: `node-pre-gyp install --fallback-to-build`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the grpc@0.14.1 install script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /home/rafael/.npm/_logs/2019-02-15T09_29_56_863Z-debug.log\nRun Code Online (Sandbox Code Playgroud)\n\n我还想知道为什么安装尝试安装名为 的东西node-pre-gyp,该东西未在以下列表中列出package.json:
{\n "name": "amp-publisher",\n "version": "0.0.1",\n "description": "A sample implementation for an AMP Publisher",\n "main": "app.js",\n "engines": {\n "node": "^4.0.0"\n },\n "author": "The AMP HTML Authors",\n "license": "Apache-2.0",\n "scripts": {\n "start": "node app.js",\n "monitor": "nodemon app.js",\n "deploy": "gcloud preview app deploy app.yaml",\n "lint": "jshint --exclude-path=.gitignore .",\n "test": "npm run lint"\n },\n "dependencies": {\n "body-parser": "1.18.3",\n "cookie-parser": "1.4.3",\n "express": "4.16.4",\n "gcloud": "^0.37.0",\n "hogan-express": "0.5.2",\n "hogan.js": "^3.0.2",\n "jsonwebtoken": "^8.0.0",\n "uuid": "3.3.2"\n },\n "devDependencies": {\n "jshint": "2.9.7"\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n非常感谢,\n拉斐尔
\n错误的原因是包的版本grpc(0.14.1) 与您使用的 NodeJs 版本 (10.15.1) 不兼容:
Pre-built binaries not found for grpc@0.14.1 and node@10.15.1
Run Code Online (Sandbox Code Playgroud)
您可以尝试使用旧版本的 NodeJs,看看是否有帮助。但如果您尝试使用更多最新的依赖项,可能会更好 -gcloud@^0.37.0已有约 2 年历史并且已被弃用。所需的
最新版本是 1.18.0。grpc@0.14.1gcloud
我还想知道为什么安装尝试安装名为 node-pre-gyp 的东西,它没有在 package.json 中列出
node-pre-gyp用于从二进制文件安装包的 C++ 模块。在您的情况下,它会自动用于安装 C++gprc包,以便您可以在 NodeJs 上下文中使用它。
| 归档时间: |
|
| 查看次数: |
7182 次 |
| 最近记录: |