create-react-app installation error

Install create-react-app

Excuting an order:

npm i -g create-react-app

The result is wrong, the error is as follows:

Lenovo@Lenovo-PC MINGW64 /d/workStation/practice/react
$ npm i -g create-react-app
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/create-react-app failed, reason: connect
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lenovo\AppData\Roaming\npm-cache\_logs\2020-07-28T06_33_46_042Z-debug.log

Taobao mirror change source:

//换源
npm config set registry https://registry.npm.taobao.org
//查看
npm config get registry

Execute the installation command again and report an error:

Lenovo@Lenovo-PC MINGW64 /d/workStation/practice/react
$ npm i -g create-react-app
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm WARN checkPermissions Missing write access to C:\Users\Lenovo\AppData\Roaming\npm\node_modul
npm ERR! path C:\Users\Lenovo\AppData\Roaming\npm\node_modules\create-react-app\node_modules\os-
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\Lenovo\AppData\Roaming\npm\n
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lenovo\AppData\Roaming\npm-cache\_logs\2020-07-28T06_40_00_579Z-debug.log

At this time, I went to the C:\Users\Lenovo\AppData\Roaming\npm\node_modules folder, deleted the create-react-app folder, and then re-executed the global installation command, and the installation was successful.
insert image description here

If you encounter any problems, record them. If there are any imprecise places, please feel free to enlighten me.

Guess you like

Origin blog.csdn.net/qq_39352780/article/details/107636846