SORU
28 ŞUBAT 2013, PERŞEMBE


Çalışan node.js bağımlılıklar için Windows üzerinde Python

Etmesinin önünü üzerinden birkaç bağımlılıkları, yani jQuery indirmek gerekiyor Node.js bir kod temeli içine alıyorum.

npm install jquery kaçmaya çalışırken bu hatayı alıyorum:

Your environment has been set up for using Node.js 0.8.21 (x64) and NPM

C:\Users\Matt Cashatt>npm install jquery
npm http GET https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/htmlparser/1.7.6
npm http GET https://registry.npmjs.org/location/0.0.1
npm http GET https://registry.npmjs.org/navigator
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser/1.7.6
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/location/0.0.1
npm http 304 https://registry.npmjs.org/navigator
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/cssstyle
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/bindings

> contextify@0.1.4 install C:\Users\Matt Cashatt\node_modules\jquery\node_module
s\contextify
> node-gyp rebuild


C:\Users\Matt Cashatt\node_modules\jquery\node_modules\contextify>node "C:\Progr
am Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\b
in\node-gyp.js" rebuild
npm http 304 https://registry.npmjs.org/cssstyle
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/request
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 (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:113:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:82:11
gyp ERR! stack     at Object.oncomplete (fs.js:297:15)
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\Matt Cashatt\node_modules\jquery\node_modules\contextify
gyp ERR! node -v v0.8.21
gyp ERR! node-gyp -v v0.8.4
gyp ERR! not ok
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\Matt Cashatt\node_
modules\jquery\node_modules\jsdom\node_modules\request\tests'
npm ERR! error rolling back  jquery@1.8.3 { [Error: ENOTEMPTY, rmdir 'C:\Users\M
att Cashatt\node_modules\jquery\node_modules\jsdom\node_modules\request\tests']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: 'C:\\Users\\Matt Cashatt\\node_modules\\jque
ry\\node_modules\\jsdom\\node_modules\\request\\tests' }
npm ERR! contextify@0.1.4 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the contextify@0.1.4 install script.
npm ERR! This is most likely a problem with the contextify 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 contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "jquery"
npm ERR! cwd C:\Users\Matt Cashatt
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat 'C:\Users\Matt Cashatt\node_modules\jquery\node_mo
dules\jsdom\node_modules\request\tests\test-pipes.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "jquery"
npm ERR! cwd C:\Users\Matt Cashatt
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! path C:\Users\Matt Cashatt\node_modules\jquery\node_modules\jsdom\node_
modules\request\tests\test-pipes.js
npm ERR! fstream_path C:\Users\Matt Cashatt\node_modules\jquery\node_modules\jsd
om\node_modules\request\tests\test-pipes.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fst
ream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Matt Cashatt\npm-debug.log
npm ERR! not ok code 0

C:\Users\Matt Cashatt>

Başarısızlık eksik bir Python kurulum kaynaklanıyor gibi görünüyor. Peki, Python değişkenleri ayarlayın ve yeniden başlattım ve bu hata hala yüklü.

Kaçırdığım ne gibi herhangi bir ipucu?

CEVAP
28 ŞUBAT 2013, PERŞEMBE


Senin sorunun da buyoktuortam değişkeni ayarlamak.

Hata açıkça şöyle diyor:

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

Ve yorum bu sen dedin:

set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib

Bu güzel, ama o PYTHON değişken seti yok, PYTHONPATH değişken ayarlar.


Bu arada, sadece set komutunu kullanarak sadece cmd geçerli oturumu etkiler. Eğer bundan sonra yeniden yaptım dediğiniz gibi, bu değişken seti yok cmd yepyeni bir oturum ile sona erecek.

Orada birkaç yolu ayarlamak için ortam değişkenleri kalıcı olarak en kolay Sistem Kontrol Panelinde XP, elbette farklı Vista'da, farklı yine 7, 8 ve yine farklı, ama google için.

Alternatif olarak, sadece arasında yeniden başlatmadan npm komut önce set doğru yap.


Doğru şeyler config script yapmaya çalışıyor aynı şeyi yaparak yaptığın olup olmadığını test edebilirsiniz: npm, %PYTHON%. çalıştırmayı deneyin çalıştırmadan Önce Eğer doğru yaptıysan bir Python yorumlayıcısı hemen çıkabilirsiniz) alırsınız. Eğer bir hata alırsanız, doğru yapmadın.


Bu iki sorunu vardır:

set PYTHON=%PYTHON%;D:\Python

Önce ;D:\Python 19 *oluyorsun. Ekstra noktalı virgül PATH PYTHONPATH ama PYTHON gibi tek bir değer değil gibi yollar noktalı virgülle ayrılmış listesi için gayet iyi. Ve aynı şekilde, mevcut değer için yeni bir değer katıyor tek bir değer için bir yol listesi için, ama başka bir yol eklemek istediğiniz zaman, istediğiniz ne. Yani, sadece set PYTHON=D:\Python istiyorum.

İkinci olarak, D:\Python Python yorumlayıcısı yolu değildir. D:\Python\Python.exe D:\Python\bin\Python.exe gibi bir şey. Doğru yolu bulmak, kendi başına çalıştığından emin olun (örneğin, tip 28 ** ve bir Python yorumlayıcısı aldığınızdan emin olun), değişken ayarlayın ve kullanın.


Yani:

set PYTHON=D:\Python\bin\Python.exe

Ya da, eğer bunu kalıcı yapmak isterseniz, Kontrol Panelindeki eşdeğer.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • buttheadgsxr1000

    buttheadgsxr

    24 Ocak 2008
  • erikbjgn's channel

    erikbjgn's c

    12 Mayıs 2008
  • FF Radioo

    FF Radioo

    14 ŞUBAT 2007