如何從python腳本安裝npm包?如何從python腳本安裝npm包?
當我使用subprocess.Popen(["node", "app.js"])
是OK。
當我使用subprocess.Popen(["npm", "install", "open"])
它是拋出一個錯誤。
很抱歉,但谷歌和DuckDuckGo今天我的朋友都沒有(
的主要問題 - 我的小工具,自動本地安裝所需的軟件包,因爲全球的包不是在窗口工作
PS。我要問這個問題,因爲我試圖制定崇高文本2
插件這是誤差在卓異蟒控制檯:
Reloading plugin …\stsync.py
Traceback (most recent call last):
File ".\sublime_plugin.py", line 103, in create_application_commands
cmds.append(class_())
File ".\stsync.py", line 16, in __init__
File ".\subprocess.py", line 633, in __init__
File ".\subprocess.py", line 842, in _execute_child
WindowsError: [Error 2]
線16:subprocess.Popen(["node", "npm", "install", "open"])
如果我將 16線改變爲subprocess.Popen([ 「節點」, 「NPM」,「安裝「,」打開「]) 然後python腳本將成功調用nodejs終端,但隨後nodejs終端將失敗並顯示錯誤:
cannot find npm module
什麼錯誤?在命令窗口中輸入npm是否有效? – wdavo
@wdavo在終端節點和npm工作正常 –
@wdavo我添加了一些問題 –