当我执行npm启动时,它给了我这个错误(是意大利语,但您可以使用Google翻译):
npm start
> codeeditor@1.0.0 start D:\CodeEditor
> electron .
"electron" non ▒ riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! codeeditor@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the codeeditor@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Giovanni\AppData\Roaming\npm-cache\_logs\2020-05-22T14_13_45_030Z-debug.log
谢谢您的帮助;)
答案 0 :(得分:0)
首先使用def getPrimeFactors(y):
AllFactors = [[x, int(y/x)] for x in range(1, (int(math.sqrt(y)+1))) if y%x==0]
Flattened_AF = [j for i in AllFactors for j in i]
print(AllFactors)
print(Flattened_AF)
if len(Flattened_AF)==2:
print(Flattened_AF)
return Flattened_AF
else:
PrimeFactors = [x for x in Flattened_AF if len(getPrimeFactors(x))==2]
print (f'loop in else - {PrimeFactors}')
print(max(PrimeFactors)
getPrimeFactors(4)
初始化def summer_69(arr):
sum = 0
Flag = False
if 6 not in arr:
for num in arr:
sum = sum + num
return sum
else:
for num in arr:
if num != 6 and Flag == False:
sum = sum + num
elif num == 6:
Flag = True
continue
elif Flag == True and num != 9:
continue
elif num == 9:
Flag = False
return sum
,然后使用npm init
安装电子。然后尝试package.json
。
答案 1 :(得分:0)
最简单的答案, 首先安装电子,然后运行。
npm install electron
还要确保您没有使用gitbash来运行npm run。