1

Windows 7 に Node.js 用の johnny five ライブラリをインストールしようとしていますが、エラーが発生し続けます。

Your environment has been set up for using Node.js 0.10.15 (x64) and npm.

C:\Users\User>npm install johnny-five
npm http GET https://registry.npmjs.org/johnny-five
npm http 304 https://registry.npmjs.org/johnny-five
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/firmata
npm http GET https://registry.npmjs.org/es6-collections
npm http GET https://registry.npmjs.org/descriptor
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/compulsive
npm http GET https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/temporal
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/firmata
npm http 304 https://registry.npmjs.org/es6-collections
npm http 304 https://registry.npmjs.org/descriptor
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/compulsive
npm http 304 https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/temporal
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/bindings/1.1.0
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/sf/0.1.6
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.
16.tgz
npm http 304 https://registry.npmjs.org/bindings/1.1.0
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http 304 https://registry.npmjs.org/sf/0.1.6

> serialport@1.1.3 install C:\Users\User\node_modules\johnny-five\node_modules
\serialport
> node-gyp rebuild


C:\Users\User\node_modules\johnny-five\node_modules\serialport>node "C:\Progra
m Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bi
n\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: ImportError: No module named site
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:637:15)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at maybeClose (child_process.js:735:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:802:
5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\node_modules\johnny-five\node_modules\serialport
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm http 200 https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.
16.tgz
npm ERR! not ok code 0

Macでも同じ問題がありましたが、以前の投稿で提案されているようにxcodeコマンドラインコンポーネントをインストールすることで解決しましたが、Windowsでこれを解決する方法がわかりません.

助けてくれてありがとう!

4

4 に答える 4

1

OK私はWindowsで同様の問題を抱えていました。Visual Studio 2012/2010 をインストールする必要があります。Vs2012がインストールされていたので、スイッチでnpmコマンドを実行しました

npm install johnny-five --msvs_version=2012 

これで問題は解決しました。基本的に、johnny Five の serialport パッケージはオペレーティング システム用に再構築する必要があるため、MSBuild を探す nodegyp パッケージを実行する必要があります。

于 2013-11-21T05:53:19.290 に答える
1

(これは、いくつかの落とし穴が追加されているだけで、オーウェンの答えとほとんど同じですが、まだコメントできないので...)

私はこれを Windows 8 で動作させましたが、その多くは Win7 にも適用されると思われます。

  • Python がインストールされていて、PATH 環境変数に含まれていることを確認します- cmd の「python --version」は「Python 2.7.5」を返すはずです (3.x は機能しません)。
  • Visual Studio Express をインストールします - http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express
  • Windows SDK をインストールします - http://msdn.microsoft.com/en-US/windows/desktop/aa904949
  • これをすべて行った後、cmd.exeの新しいインスタンスを開くことを忘れないでください(違いが生じる場合に備えて、nodejs固有のものを使用しています)、通常は環境の変更を取得しません

arduino 自体については、忘れずにドライバー ( http://arduino.cc/en/Guide/windows ) を確認し、com ポートを Johnny Five ( https://github.com/rwaldron/johnny-five ) にフィードする必要がありました。 /blob/master/docs/board-with-port.md )。

于 2013-09-05T14:48:00.157 に答える
0

実行に必要なすべてのソフトウェアがあることを確認してくださいnode-gyp

環境変数を介して使用される Visual Studio のバージョンを構成gypできるため、--msvs_version=2012プロパティを設定する必要がなくなります。

例:

  • GYP_MSVS_VERSION=2012Visual Studio 2012 用に設定
  • セットGYP_MSVS_VERSION=2013e(「e」は「エクスプレス エディション」を表します)

完全なリストについては、https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294を参照してください。

Python と Visual Studio のコピーがインストールされていることを前提としており、多くのエンド ユーザーは決してこれを持っていないため、これは NodeJS の Windows ユーザーにとっては依然として苦痛です。したがって、私は Joyent にロビー活動を行って、CORE ノードの一部として Web ソケットを含めることを奨励し、NodeJS インストールの一部として GNU gcc コンパイラを出荷して、この問題を永久に修正できるようにすることもできます。

自由に投票してください:

于 2014-08-01T01:40:30.160 に答える
0

特定のエラーについてはわかりませんが、すべての Visual Studio 製品をアンインストールしてhttps://github.com/TooTallNate/node-gypの指示に従うまで、Windows に npm をインストールすると、さまざまな node-gyp 関連のエラーが発生しました。これには、具体的には Visual Studio 2010 (動作しなかった 2012 ではありません)、SDK、および SDK の更新が含まれます。これらの手順を正確に実行した後、エラーが発生しなくなりました (数分前に成功した Johnny Five のテスト インストールも含まれます。これらの手順をまだ実行していない場合は、試してみる価値があります。

于 2013-08-03T19:03:18.457 に答える