'npm init @eslint/config error & npx create-react-app my-app error
Hi all I am new to react/node. I tried to learn these by following the tutorial guide. It was successful to build a new react project and install eslint on the first try. However, there was an accident so I have to restore my PC and re-install my VS code and node.js. Then I tried to build a new react project again but it failed.
PS C:\Users\JUI> npx create-react-app my-app
'create-react-app' is not recognized as an internal or external command,
operable program or batch file.
I know that npm install -g create-react-app then npm create-react-app my-app would succeed to create but I wonder why npx would fail.
After that I tried to install expo npm install --global expo-cli to create a new react native app expo init Ahjuisingyen and its success. Then I tried to install eslint into my project but it failed.
PS C:\Users\JUI\Ahjuisingyen> eslint --init
You can also run this command directly using 'npm init @eslint/config'.
'create-config' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code 1
npm ERR! path C:\Users\JUI\Ahjuisingyen
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-config
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\JUI\AppData\Local\npm-cache\_logs\2022-03-30T03_44_34_043Z-debug-0.log
C:\Users\JUI\AppData\Local\npm-cache_logs\2022-03-30T03_44_34_043Z-debug-0.log
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'init',
0 verbose cli '@eslint/config'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\JUI\Ahjuisingyen\.npmrc Completed in 1ms
10 timing config:load:project Completed in 6ms
11 timing config:load:file:C:\Users\JUI\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\JUI\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 14ms
19 timing npm:load:configload Completed in 14ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 4ms
23 verbose logfile C:\Users\JUI\AppData\Local\npm-cache\_logs\2022-03-30T03_44_34_043Z-debug-0.log
24 timing npm:load:logFile Completed in 5ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 24ms
28 silly logfile start cleaning logs, removing 2 files
29 http fetch GET 200 https://registry.npmjs.org/@eslint%2fcreate-config 119ms (cache revalidated)
30 timing arborist:ctor Completed in 1ms
31 timing arborist:ctor Completed in 0ms
32 timing arborist:ctor Completed in 0ms
33 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/ajv
34 timing command:init Completed in 659ms
35 verbose stack Error: command failed
35 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
35 verbose stack at ChildProcess.emit (node:events:526:28)
35 verbose stack at maybeClose (node:internal/child_process:1092:16)
35 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
36 verbose pkgid [email protected]
37 verbose cwd C:\Users\JUI\Ahjuisingyen
38 verbose Windows_NT 10.0.19044
39 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "init" "@eslint/config"
40 verbose node v16.14.2
41 verbose npm v8.5.0
42 error code 1
43 error path C:\Users\JUI\Ahjuisingyen
44 error command failed
45 error command C:\WINDOWS\system32\cmd.exe /d /s /c create-config
46 verbose exit 1
47 timing npm Completed in 993ms
48 verbose code 1
49 error A complete log of this run can be found in:
49 error C:\Users\JUI\AppData\Local\npm-cache\_logs\2022-03-30T03_44_34_043Z-debug-0.log
Other references that may be useful:
PS C:\Users\JUI\Ahjuisingyen> npm ls -g
C:\Users\JUI\AppData\Roaming\npm
└── [email protected]


PS C:\Users\JUI\Ahjuisingyen> node -v
v16.14.2
PS C:\Users\JUI\Ahjuisingyen> npm -v
8.5.0
PS C:\Users\JUI\Ahjuisingyen> npx -v
8.5.0
I googled and tried every method but still no luck. Not sure if these two questions are related so I just put them together. Any help would be appreciated. Thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
