问题标签 [node-pre-gyp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
1820 浏览

node.js - npm install sqlite3 - gyp 错误:无法获取本地颁发者证书

我正在进行干净的 Windows 10 安装。尝试npm install sqlite3myproject路径运行时,出现以下错误:

我已经尝试过一些解决方案,strict-ssl=false但没有找到适合我的解决方案,但仍然不明白这个错误的根本原因是什么。

我还尝试在 sqlite3 上安装一些以前的版本并得到:

因此,我尝试通过将版本从 更改为直接 GET 请求,v3.1.1v4.1.1发现以下内容:

使用 is 发出请求时SSL certificate verificationon请求失败,何时off成功并下载文件。

我的结论是,这个包的证书检查存在问题,邮递员知道要处理它,问题是如何在 npm 上处理它,特别是在 Windows 上运行时。

0 投票
0 回答
251 浏览

node.js - MeteorJS Mup 部署:挂在“node-pre-gyp WARN 使用 node-pre-gyp https 下载请求”

我的 MeteorJS mup 部署到数字海洋今天突然停止工作。

在尝试通过 MUP 部署到服务器时,它成功地将捆绑包推送到服务器,但 --verbose 显示它只是挂在下面并且没有成功“准备捆绑包”。根本没有错误——不管我离开多久。该应用程序在我的本地主机上运行良好。

我在 Meteor 1.10.2、Node 12.16.1 和 NPM 6.14 上。

挂在 MUP 'Prepare bundle' 的点如下:

Canvas 是 FabricJS 的依赖项,都是 NPM 模块。我昨天已经用 FabricJS 成功部署到服务器了

0 投票
1 回答
490 浏览

linux - npm 安装错误:sqlite 从不下载

在运行npm install下载项目依赖项时,sqlite3遇到错误并且永远不会安装。尝试npm install sqlite3会产生相同的错误。

在 ChromeOS 上的 Linux Beta (Debian v10 buster) 上运行。

在别人的机器上安装很好。预计它与 ChromeOS 有关。

项目文件链接:https ://github.com/andrewbruner/fsjs-techdegree-unit-09

0 投票
2 回答
1778 浏览

node.js - 如何解决 /bin/sh: node-pre-gyp: not found 的 docker 相关问题?

一天前,我开始自学Docker。所以我将应用下载到我的 Windows 10 桌面,并开始学习他们通过应用推荐的教程。有一次,他们要求我创建一个包含以下内容的 docker 文件:

FROM node:12-alpine WORKDIR /app COPY . . RUN yarn install --production CMD ["node", "/app/src/index.js"]

我对路径所做的事情:D:\docker_stuff\app名称为“Dockerfile”,没有扩展名。接下来他们要求我运行这个命令“docker build -t getting-started”。这是我遇到问题的地方,因为该命令会引发以下错误:

D:\docker_stuff\app>docker build -t getting-started . Sending build context to Docker daemon 4.673MB Step 1/5 : FROM node:12-alpine ---> 7a48db49edbf Step 2/5 : WORKDIR D:\docker_stuff\app ---> Using cache ---> 44ba6501de00 Step 3/5 : COPY . . ---> 44164775d408 Step 4/5 : RUN yarn install --production ---> Running in 5df554d6bac8 yarn install v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.9: The platform "linux" is incompatible with this module. info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. error /D:docker_stuffapp/node_modules/bcrypt: Command failed. Exit code: 127 Command: node-pre-gyp install --fallback-to-build Arguments: Directory: /D:docker_stuffapp/node_modules/bcrypt Output: /bin/sh: node-pre-gyp: not found

我尝试了什么:

  1. 安装节点

D:\docker_stuff\app>node -v v12.16.3;

  1. 安装 npm

D:\docker_stuff\app>npm -v 6.14.4;

  1. 独立运行命令: node-pre-gyp install --fallback-to-build 引发更多问题:

D:\docker_stuff\app>node-pre-gyp install --fallback-to-build node-pre-gyp info it worked if it ends with ok node-pre-gyp info using node-pre-gyp@0.14.0 node-pre-gyp info using node@12.16.3 | win32 | x64 node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp ERR! install error node-pre-gyp ERR! stack Error: 101-app package.json is not node-pre-gyp ready: node-pre-gyp ERR! stack package.json must declare these properties: node-pre-gyp ERR! stack binary.module_name node-pre-gyp ERR! stack binary.module_path node-pre-gyp ERR! stack binary.host node-pre-gyp ERR! stack at validate_config (C:\Users\KahnTrevor\AppData\Roaming\npm\node_modules\node-pre-gyp\lib\util\versioning.js:220:15) node-pre-gyp ERR! stack at Object.module.exports.evaluate (C:\Users\KahnTrevor\AppData\Roaming\npm\node_modules\node-pre-gyp\lib\util\versioning.js:279:5) node-pre-gyp ERR! stack at install (C:\Users\KahnTrevor\AppData\Roaming\npm\node_modules\node-pre-gyp\lib\install.js:241:31) node-pre-gyp ERR! stack at Object.self.commands.<computed> [as install] (C:\Users\KahnTrevor\AppData\Roaming\npm\node_modules\node-pre-gyp\lib\node-pre-gyp.js:52:37) node-pre-gyp ERR! stack at run (C:\Users\KahnTrevor\AppData\Roaming\npm\node_modules\node-pre-gyp\bin\node-pre-gyp:82:30) node-pre-gyp ERR! stack at Object.<anonymous> (C:\Users\KahnTrevor\AppData\Roaming\npm\node_modules\node-pre-gyp\bin\node-pre-gyp:134:1) node-pre-gyp ERR! stack at Module._compile (internal/modules/cjs/loader.js:1133:30) node-pre-gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10) node-pre-gyp ERR! stack at Module.load (internal/modules/cjs/loader.js:977:32) node-pre-gyp ERR! stack at Function.Module._load (internal/modules/cjs/loader.js:877:14) node-pre-gyp ERR! System Windows_NT 10.0.18363 node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\KahnTrevor\\AppData\\Roaming\\npm\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd D:\docker_stuff\app node-pre-gyp ERR! node -v v12.16.3 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 node-pre-gyp ERR! not ok 101-app package.json is not node-pre-gyp ready: package.json must declare these properties: binary.module_name binary.module_path binary.host

  1. 修改了 git 项目中的 package.json 文件,我在 "dependencies" 下添加了行 <"bcrypt": "^3.0.6",>: { ;

  2. Python 已安装。

我觉得 package.json 文件而不是我的桌面可能存在问题,但我不确定,如果这是问题,我该如何解决?我知道我是菜鸟,但谁能给我一些指导?

0 投票
1 回答
3515 浏览

docker - 如何修复 gyp ERR!在 npm 构建中

我最近构建了一个平均堆栈应用程序并将其容器化。但是,我在我的树莓派上构建它时遇到了麻烦,我不明白这个错误。

当我在我的 debian 机器上构建我的应用程序时,一切都构建得很完美。即使我在构建过程中得到这条线:

不幸的是,我无法在我的树莓派上构建相同的容器。此警告变得更糟,并以错误代码 1 退出:

我不明白这个错误代码,因为我有 python、python2 和 python3。此外,如果我输入 npm install node-pre-gyp 它正在工作但不在容器内。我试图清理 npm 缓存并与不同的 nodejs 版本一起使用。最初的一个,12.16.3 和 14.x 一个。

你能向我解释为什么会出现这个错误吗?我应该填写什么依赖项以及如何在容器中获取日志?

0 投票
0 回答
178 浏览

node.js - node-pre-gyp install --fallback-to-build html-to-docx

有谁知道是什么导致了这个错误?

只有当我尝试安装这个 html-to-docx 包时,其他的都很好。

我已经尝试将 gyp 手动添加到 package.json,使用 nvm 降级 node.js 以及使用 --build-from-source 标志进行安装。

下面的输出:

0 投票
1 回答
337 浏览

node.js - 如何在 yocto 中安装 node-sqlite3?

我有一个 node.js 项目,我在其中使用 node-sqlite3 来读写 sqlite3 数据库。

我正在使用 devtool 为 node.js 生成配方。

当我尝试“bitbake node-project”时生成配方后。sqlite3 给出了 node-gyp 和 node-pre-gyp 的错误。

我不知道我该如何解决这个问题。有人可以帮忙吗?

0 投票
0 回答
109 浏览

node.js - 使用 WSL 为 Raspi (ARM) 构建 sqlite3

我想在我的 WSL 中构建 sqlite3(在 64 位机器上使用 Debian)将它部署在我的树莓上。

我正在使用以下命令

构建模块:node_modules/sqlite3/lib/binding/napi-v3-linux-arm/node_sqlite3.node

但是,它不是 ARM 模块。如果我打开 node_sqlite3.node,它不包含任何 .ARM 文件。

包.json:

这里 package-lock.json

如果我想在树莓上启动项目,我会收到以下错误:

它不是为 ARM 构建的,尽管它已经设置好了。

0 投票
1 回答
2957 浏览

node.js - node-pre-gyp --fallback-to-build error while installing canvas module

I am facing issues while deploying my project to ElasticBeanStalk there is node-pre-gyp --fallback-to-build error while installing canvas 2.7.0 module.

I am not sure this is permission error which is metion as

Here my error in eb-engine.log

I have also mention node and npm version in my package.json, and added into .npmrc file too

0 投票
0 回答
122 浏览

node.js - 在 NodeJS 上安装 sqlite3@5.0.2 时遇到问题

我正在尝试安装最新版本的 sqlite3 模块来测试我的数据库模型。请注意,我使用的是 Ubuntu 21.04。但我收到了这个错误。这是日志:

519 info run sqlite3@5.0.2 install node_modules/sqlite3 node-pre-gyp install --fallback-to-build 520 info run sqlite3@5.0.2 install { code: 1, signal: null } 521 http fetch POST 200 https: //registry.npmjs.org/-/npm/v1/security/advisories/bulk496ms 522 定时 auditReport:getReport 在 498ms 内完成 523 定时 auditReport:init 在 0ms 内完成 524 定时 reify:audit 在 499ms 内完成 525 定时 reify:rollback:createSparse 在 86ms 内完成 526 定时 reify:rollback:retireShallow 在 0ms 内完成 527 定时命令:install在 2791 毫秒内完成 528 详细堆栈错误:命令在 ChildProcess 失败 528 详细堆栈。(/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)在 ChildProcess 的 528 详细堆栈.emit (events.js:315:20) 528 详细堆栈在可能关闭 (internal/child_process.js:1048:16) 528 详细堆栈在 Socket。(internal/child_process.js:439:11) Socket.emit 的 528 个详细堆栈 (events.js:315:20) Pipe 的 528 个详细堆栈。(net.js:673:12) 529 详细 pkgid sqlite3@5.0。

据我所知,这是node-pre-gyp产生的错误。我正在使用最新版本的 NPM 和 NodeJS。我尝试过其他版本的 SQLite3,如 4.1.1 或 5.0.0,但我得到了同样的错误。我在全球范围内重新安装了 node-pre-gyp,但什么也没发生。我已经清理了 npm 缓存等。

任何人都有一个想法是怎么回事?