react的安装和启动方法

1、npx create-react-app <app-name>

(用npx会自动安装create-react-app,免去版本选择烦恼)

2、cd <app-name>
3、yarn start

(如果报错,删掉node_modules,package-lock.json,重新npm install ,如果网不行,切换热点)

internal/modules/cjs/loader.js:638
    throw err;
    ^ Error: Cannot find module 'es-abstract/2020/CreateDataProperty'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous>  (D:\NodejsProjects\reactapp\node_modules\object.getownpr opertydescriptors\implementation.js:3:26)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this  comman d.

如上报错,实测 npm install es-abstract无法解决,需要采用上述解决办法

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐