出于某种原因,我试图在我的计算机上手动安装serialport模块。我试过复制github文件,然后将其粘贴到漫游文件夹中,但后来遇到了以下问题。
└─┬ serialport@4.0.1
├── UNMET DEPENDENCY bindings@1.2.1
├── UNMET DEPENDENCY commander@^2.9.0
├── UNMET DEPENDENCY debug@^2.1.1
├── UNMET DEPENDENCY lie@^3.1.0
├── UNMET DEPENDENCY nan@^2.3.5
├── UNMET DEPENDENCY node-pre-gyp@^0.6.26
└── UNMET DEPENDENCY object.assign@^4.0.3
npm ERR! missing: bindings@1.2.1, required by serialport@4.0.1
npm ERR! missing: commander@^2.9.0, required by serialport@4.0.1
npm ERR! missing: debug@^2.1.1, required by serialport@4.0.1
npm ERR! missing: lie@^3.1.0, required by serialport@4.0.1
npm ERR! missing: nan@^2.3.5, required by serialport@4.0.1
npm ERR! missing: node-pre-gyp@^0.6.26, required by serialport@4.0.1
npm ERR! missing: object.assign@^4.0.3, required by serialport@4.0.1
我正在尝试从Windows命令提示符运行serialport-list
。串口的原因。
当我尝试以正常方式进行串口传输时,我遇到以下错误:
vcbuild.exe : error VCBLD0010: Project 'C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport\build\serialport.
vcproj' requires upgrade. Use 'vcbuild /upgrade' or 'devenv /upgrade' to upgrade the project. [C:\Users\Jonathan\AppDat
a\Roaming\npm\node_modules\serialport\build\binding.sln]
我可以;因为文件不存在而应用升级,所以我手动下载了serialport.vcproj文件并应用了升级,然后复制了serialport节点模块,但仍然无法运行serialport-list
关闭命令提示符。
更新
C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport>vcbuild /upgrade C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport\build\serialport.vcproj
Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.30729
Copyright (C) Microsoft Corporation. All rights reserved.
Successfully upgraded project file 'C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport\build\serialport.vcproj'.
C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport>npm install
> serialport@4.0.1 install C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.1/serialport-v4.0.1-node-v44-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.1 and node@2.2.1 (node-v44 ABI) (falling back to source compile with node-gyp)
C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport>if not defined npm_config_node_gyp (node "C:\Program Files\iojs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node clean )
gyp ERR! clean error
gyp ERR! stack Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport\build'
gyp ERR! stack at Error (native)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\iojs\\node.exe" "C:\\Program Files\\iojs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "clean"
gyp ERR! cwd C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport
gyp ERR! node -v v2.2.1
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd clean' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:763:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:210:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "C:\\Program Files\\iojs\\node.exe" "C:\\Users\\Jonathan\\AppData\\Roaming\\npm\\node_modules\\serialport\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Jonathan\AppData\Roaming\npm\node_modules\serialport
node-pre-gyp ERR! node -v v2.2.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.29
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd clean' (1)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\iojs\\node.exe" "C:\\Program Files\\iojs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v2.2.1
npm ERR! npm v2.11.0
npm ERR! code ELIFECYCLE
npm ERR! serialport@4.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@4.0.1 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! 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 their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
答案 0 :(得分:1)
如果你克隆了github存储库,你应该进入克隆文件夹并运行npm install来安装serialport的依赖项。