2

Windows7でnode-weakを読み込めないようです。私はPython2.7、2.5、2.3を試しましたが、役に立ちませんでした。(以下のエラーから)Python2のバージョンを使用する必要があるようですが、バージョンを変更しても効果がないようです。どんな助けでも大歓迎です。

C:\project1\node_modules\weak>node "C:\Program Files (x86)\nodejs\node_modules\npm\
bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! rebuild error Error: Python executable "c:\Python25\python.exe" is Pyth
on 3, which is not supported.

gyp ERR! rebuild error     at failPython3 (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\node-gyp\lib\configure.js:90:14)
gyp ERR! rebuild error     at C:\Program Files (x86)\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:79:9
gyp ERR! rebuild error     at ChildProcess.exithandler (child_process.js:534:7)
gyp ERR! rebuild error     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error     at maybeClose (child_process.js:634:16)
gyp ERR! rebuild error     at Process._handle.onexit (child_process.js:676:5)
gyp ERR! not ok
npm ERR! weak@0.2.1 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the weak@0.2.1 install script.
npm ERR! This is most likely a problem with the weak package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls weak
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" "weak"
npm ERR! cwd C:\project1
npm ERR! node -v v0.8.1
npm ERR! npm -v 1.1.33
npm ERR! code ELIFECYCLE
npm ERR! message weak@0.2.1 install: `node-gyp rebuild`
npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\project1\npm-debug.log
npm ERR! not ok code 0
4

2 に答える 2

2

どうやらnode-gyp@0.5.2には、Pythonのバージョン番号を正しく解析できないバグがありましたが、それは036a730f4a3a95e65d8f390f7f5c4f0d3321e422(0.5.3)で修正されました。この問題を修正するには、node-gypを更新する必要がありました。

cd "C:\Program Files (x86)\nodejs"
npm install node-gyp

簡単な解決策ですが、追跡するのが難しい問題です。

于 2012-07-12T00:47:30.973 に答える
0

Windows7ホストのLinuxMintのVirtualboxでも同様の問題が発生しました。apt-getで取得したnodejs(v0.6.19)とnpm(v1.1.14)のライブラリは古くなっていました。ここからソースコードを介してnpm(v1.3.11)とnodejs(v0.10.20)の両方をインストールしました。

共有フォルダーでシンボリックリンクの作成が無効になっているため、共有フォルダーでコードをコンパイルするときにエラーが発生しました。そこで、zipを抽出し、コンパイルして、共有フォルダーの外にこれらのファイルをインストールしました。これで問題はすぐに解決しました。

于 2013-10-01T13:41:53.567 に答える