• 瑞泉
    2020-01-27
    老师,按要求设置 BROWSER=none react-scripts start,启动后报错:
    'BROWSER' is not recognized as an internal or external command,
    operable program or batch file.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! main@0.1.0 start: `BROWSER=none react-scripts start`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the main@0.1.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\Gree\AppData\Roaming\npm-cache\_logs\2020-01-27T12_21_05_394Z-debug.log
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! remote-control@1.0.0 start:render: `cd app/renderer/src/main && npm start`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the remote-control@1.0.0 start:render 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\Gree\AppData\Roaming\npm-cache\_logs\2020-01-27T12_21_05_536Z-debug.log
    在网上搜不到解决方法,望老师支招……
    展开

    作者回复: win上的话应该是环境变量不能这么设,你装一个cross-env,之后在BROWSER前面加上cross-env

    
     1
  • 梦牵绕了谁的灵魂
    2020-02-05
    老师,我用npx创建不了react项目?这个怎么搞?

    作者回复: 看看你的node,npm版本是不是有点低了,我用的是12.14,nvm install 12.14,nvm use 12.14试试

     1
    
  • 🌀Pick Monster ...
    2020-02-05
    老师,发现使用npm start启动render和electron之后,关闭electron窗口后electron程序停止了,但是React程序没有停止,如果项目打包后会不会出现React程序一直没有被停止的情况?

    作者回复: 打包后当然不会,打完包就是一个静态页。第三章会讲到

    
    
  • Geek_0a41b1
    2020-02-03
    react集成的那一节有点复杂

    作者回复: 其实如果不篡改,直接用window.require还是比较简单的。实际项目中几乎都是按项目需求配置的。

    
    
  • 暴怒侠(有牙齿的IT妞...
    2020-01-30
    http://t.cn/A6vJWcdN does not work here. it redirect to a 404 page

    作者回复: 更新链接了

    
    
我们在线,来聊聊吧