impossible de trouver le module 'serialport" à l'aide d'Node.js et Johnny-Cinq

J'ai essayé d'utiliser Johnny-cinq et node.js pour exécuter un script pour, à l'aide de Leap Motion Controls. maintenant, quand j'essaie d'exécuter le script, il est dit: (Erreur: Impossible de trouver le module 'serialport') j'ai essayé npm install-g port série, il traverse alors donnez-moi beaucoup de (err) les codes en rouge . comment puis-je résoudre ce problème ?

D:>nœud robotarm.js

module.js:338
    throw err;
          ^
Error: Cannot find module 'serialport'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Board.Serial.detect (D:\node_modules\johnny-five\lib\board.js:70:7)
    at new Board (D:\node_modules\johnny-five\lib\board.js:303:23)
    at Object.<anonymous> (D:\robotarm.js:90:9)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)

#

puis-je l'essayer

D:>npm install serialport

il donne

npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/sf
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/sf
npm http 304 https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/minimist
> serialport@1.4.10 install D:\node_modules\serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.4.1
0/Release/node-v14-win32-x64.tar.gz
node-pre-gyp http 404 https://node-serialport.s3.amazonaws.com/serialport/v1.4.1
0/Release/node-v14-win32-x64.tar.gz
node-pre-gyp http Pre-built binary not available for your system (falling back t
o source compile with node-gyp)
child_process: customFds option is deprecated, use stdio instead.
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (D:\node_modules\node-gyp\lib\configure.js:10
3:14)
gyp ERR! stack     at D:\node_modules\node-gyp\lib\configure.js:64:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:99:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "D:\\node_modules\\
node-gyp\\bin\\node-gyp.js" "rebuild" "--name=serialport" "--configuration=Relea
se" "--module_name=serialport" "--version=1.4.10" "--major=1" "--minor=4" "--pat
ch=10" "--runtime=node" "--node_abi=node-v14" "--platform=win32" "--target_platf
orm=win32" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host
=https://node-serialport.s3.amazonaws.com/" "--module_path=D:\\node_modules\\ser
ialport\\build\\serialport\\v1.4.10\\Release\\node-v14-win32-x64" "--remote_path
=./serialport/v1.4.10/Release/" "--package_name=node-v14-win32-x64.tar.gz" "--st
aged_tarball=build\\stage\\serialport\\v1.4.10\\Release\\node-v14-win32-x64.tar.
gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.10/R
elease/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v
1.4.10/Release/node-v14-win32-x64.tar.gz"
gyp ERR! cwd D:\node_modules\serialport
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\
node.exe rebuild --name=serialport --configuration=Release --module_name=serialp
ort --version=1.4.10 --major=1 --minor=4 --patch=10 --runtime=node --node_abi=no
de-v14 --platform=win32 --target_platform=win32 --arch=x64 --target_arch=x64 --m
odule_main=./serialport --host=https://node-serialport.s3.amazonaws.com/--modul
e_path=D:\node_modules\serialport\build\serialport\v1.4.10\Release\node-v14-win3
2-x64 --remote_path=./serialport/v1.4.10/Release/ --package_name=node-v14-win32-
x64.tar.gz --staged_tarball=build\stage\serialport\v1.4.10\Release\node-v14-win3
2-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v
1.4.10/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serial
port/v1.4.10/Release/node-v14-win32-x64.tar.gz' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\node_modules\serialp
ort\node_modules\node-pre-gyp\lib\util\compile.js:76:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1008:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_proces
s.js:1080:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "node" "D:\\node_modules\\serialport\\node_modules\\no
de-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\node_modules\serialport
node-pre-gyp ERR! node -v v0.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files (x86)\nodejs\node.exe rebuild --name=serialp
ort --configuration=Release --module_name=serialport --version=1.4.10 --major=1
--minor=4 --patch=10 --runtime=node --node_abi=node-v14 --platform=win32 --targe
t_platform=win32 --arch=x64 --target_arch=x64 --module_main=./serialport --host=
https://node-serialport.s3.amazonaws.com/--module_path=D:\node_modules\serialpo
rt\build\serialport\v1.4.10\Release\node-v14-win32-x64 --remote_path=./serialpor
t/v1.4.10/Release/ --package_name=node-v14-win32-x64.tar.gz --staged_tarball=bui
ld\stage\serialport\v1.4.10\Release\node-v14-win32-x64.tar.gz --hosted_path=http
s://node-serialport.s3.amazonaws.com/serialport/v1.4.10/Release/--hosted_tarbal
l=https://node-serialport.s3.amazonaws.com/serialport/v1.4.10/Release/node-v14-w
in32-x64.tar.gz' (1)
npm ERR! serialport@1.4.10 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.10 install script.
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.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "serialport"
npm ERR! cwd D:\
npm ERR! node -v v0.12.0
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\npm-debug.log
npm ERR! not ok code 0 
  • Sans en connaître la réelle erreurs que vous ne nous montrez pas, nous ne pouvons pas vous dire comment les corriger. Une chose peut-être que vous effectuez l'installation à l'échelle mondiale (g) et vous devez généralement utiliser sudo pour le faire.
  • im en utilisant windows 7 64 bits, et je vais poster les erreurs juste attendre un peu
  • comment puis-je le publier son trop long ? je pourrais le télécharger ou l'autre question
  • Au moins les premiers big red ERR lignes de mnp.
  • il est là maintenant, toute la question édité remercie de votre aide..
  • On dirait que vous ne peut pas avoir le nécessaire de construire des outils installés. L'erreur vous demande précisément de faire "nœud-pré-gyp install --secours à construire", avez-vous fait?
  • qu'est ce que si je peux demander ? je n'ai pas l'obtenir im un peu pas très bon à ça. et comment puis-je le faire ?
  • Passons sur le fait, vous avez fait cela, ou il l'a fait pour vous. Ce qu'il dit, c'est qu'il ne peut pas trouver un binaires pré-compilés de cette version de la serialport module pour votre plate-forme (Windows 64-bit), il veut le construire à partir de la source, ce qui nécessite des outils comme Python et Visual Studio que vous n'avez pas. Peut-être en utilisant une autre version de serialport pourrait l'aider.
  • comme comment ? u signifie le pilote ! je pense que c'est la node.js erreur de programme. je ne sais pas. j'espère que quelqu'un pourrait m'aider à savoir comment résoudre le problème

InformationsquelleAutor rdmentalist | 2015-02-09