0

我正在尝试安装我们的 Node 串行小部件,它允许 PHP 服务的站点与本地机器的串行端口和我们的远程服务器(使用 MariaDB)进行通信。我要安装的站点位于德国(但在我们的域中,因此我可以将它们视为本地站点)。虽然我在西雅图地区的机器上工作时有延迟,但我可以通过 VNC Viewer 从这里做任何我需要做的事情。

我们已经成功地将这个软件部署到了大约十几台本地(西雅图地区)服务计算机,但它们都是 64 位 Win7 Pro 机器,是默认的英文版 Windows。这台机器是使用英语语言包的 32 位德语版本的 Win7 Pro。我不知道这是否相关,但唯一的两个变量似乎是 32 位和德语 Windows。我们已经使用 32 位 VM 成功完成了测试安装,所以它似乎取决于德语 Windows,除非我遗漏了其他东西。

这是我所做的:

我已经成功安装:

  • 节点.js 6.9.5

  • NPM 3.10.10

  • Python 2.7.13

  • 根据此处找到的说明构建 Windows 工具。

  • 适用于 VS 2015 的 Visual Studio 构建工具(也尝试使用 VS 2013)

  • 节点 gyp

  • 节点预gyp

然后我尝试进行这些配置更改

$ npm config set msvs_version 2015
$ set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140

错误没有变化。

这是我们的 package.json:

{
  "name": "sbeserialwidget",
  "version": "0.0.1",
  "description": "",
  "main": "server.js",
  "directories": {
    "test": "test"
  },
  "scripts": {
    "test": "node_modules\\.bin\\mocha --reporter spec"
  },
  "license": "ISC",
  "dependencies": {
    "chai": "^3.5.0",
    "dns": "^0.2.2",
    "express": "^4.14.0",
    "fs-extra": "^0.30.0",
    "mocha": "^3.0.2",
    "moment": "^2.15.1",
    "os": "^0.1.1",
    "request": "^2.74.0",
    "serialport": "^4.0.1",
    "socket.io": "^1.4.8",
    "username": "^2.2.2"
  }
}

我也尝试安装 serialport.js 独立,同样的错误。我们的其他依赖项似乎都没有问题,但是如果没有 serialport.js,该软件就毫无用处。

这些都没有奏效,我仍然收到下面详述的错误(抱歉有点长)。最初的错误似乎在文本的第 5 行:

node-pre-gyp ERR! Tried to download(undefined): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v48-win32-ia32.tar.gz* :

C:\Program Files\Sea-Bird\sbSerialWidget>npm install

> serialport@4.0.7 install C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v48-win32-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.7 and node@6.9.5 (node-v48 ABI) (falling back to source compile with node-gyp)

C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean)

C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build "--module=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release\serialport.node" --module_name=serialport "--module_path=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release" --python=C:\Users\SeabirdUSA\.windows-build-tools\python27\python.exe --msvs_version=2015 )else (node "" configure --fallback-to-build"--module=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release\serialport.node" --module_name=serialport "--module_path=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release" --python=C:\Users\SeabirdUSA\.windows-build-tools\python27\python.exe --msvs_version=2015 )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1079:38)
gyp ERR! stack     at emitNone (events.js:86:13)
gyp ERR! stack     at TLSSocket.emit (events.js:185:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Program Files\\Sea-Bird\\sbSerialWidget\\node_modules\\serialport\\build\\Release\\serialport.node" "--module_name=serialport" "--module_path=C:\\Program Files\\Sea-Bird\\sbSerialWidget\\node_modules\\serialport\\build\\Release" "--python=C:\\Users\\SeabirdUSA\\.windows-build-tools\\python27\\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release\serialport.node --module_name=serialport --module_path=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release --python=C:\Users\SeabirdUSA\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\node_modules\node-pre-gyp\lib\util\com
pile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\Sea-Bird\\sbSerialWidget\\node_modules\\serialport\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport
node-pre-gyp ERR! node -v v6.9.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release\serialport.node --module_name=serialport --module_path=C:\Program Files\Sea-Bird\sbSerialWidget\node_modules\serialport\build\Release --python=C:\Users\SeabirdUSA\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
npm WARN sbeserialwidget@0.0.1 No description
npm WARN sbeserialwidget@0.0.1 No repository field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! serialport@4.0.7 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@4.0.7 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Program Files\Sea-Bird\sbSerialWidget\npm-debug.log
4

1 回答 1

0

这并没有真正解决,而是解决了。 请参阅与 Serialport 人员在 Github 上的随附讨论。 可以在此处找到以下每个讨论点的链接。即使有链接的信息,仍然需要花费几个小时的时间来安装我们的软件并使其正常运行。

基本上它归结为:

  • 下载并安装相应版本的 Node.js。
  • 对 npm 做一些配置
  • 安装和构建 node-gyp 的所有依赖项以及 Python 2.7x 和 Windows 构建工具。
  • 安装并构建 node-pre-gyp 的所有依赖项。

也许这会帮助其他在需要 Serialport 插件的 32 位 Windows 安装中遇到类似问题的人。

于 2017-02-17T17:15:54.080 回答