简体   繁体   English

create-react-app 不起作用

[英]create-react-app does not work

i am trying to start with a react project and i installed create-react-app with npm.我正在尝试从一个 React 项目开始,并且我使用 npm 安装了 create-react-app。 When i do the command create-react-app pseudogram i get the following error:当我执行命令 create-react-app 伪图时,我收到以下错误:

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module 'C:\Users\leonel\Desktop\pseudogram\node_modules\react-scripts\package.json'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at checkNodeVersion (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:476:23)
    at getPackageName.then.then.then.packageName (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:283:7)
    at process._tickCallback (internal/process/next_tick.js:109:7) code: 'MODULE_NOT_FOUND' }

I tried with different versions of node and npm and still does not work.我尝试了不同版本的 node 和 npm,但仍然无法正常工作。

Thanks in advance提前致谢

$ npm i -g create-react-app . $ npm i -g create-react-app Install it globally.全局安装。

After that, in your terminal, type $ create-react-app name-of-the-app , then $ cd name-of-the-app and finally $ npm start .之后,在您的终端中,输入$ create-react-app name-of-the-app ,然后是$ cd name-of-the-app ,最后是$ npm start

The documentation will print automatically after it finishes installing.安装完成后,文档将自动打印。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM