'npm init @eslint/config error & npx create-react-app . error

When i try to init a eslint config file for my node project with npm init @eslint/config. below is the error i am getting, I tried to downgrade node versio, upgrade npm to latest version, clear node cache nothing worked out.

Tried to google and could'nt find anything to this particular issue.

0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Users\\sakth\\AppData\\Roaming\\npm\\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:\Users\sakth\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:D:\Projects\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\sakth\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\sakth\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 11ms
19 timing npm:load:configload Completed in 11ms
20 timing npm:load:setTitle Completed in 1ms
21 timing config:load:flatten Completed in 3ms
22 timing npm:load:display Completed in 5ms
23 verbose logfile C:\Users\sakth\AppData\Local\npm-cache\_logs\2022-03-08T16_30_49_917Z-debug-0.log
24 timing npm:load:logFile Completed in 36ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 53ms
28 silly logfile start cleaning logs, removing 4 files
29 http fetch GET 200 https://registry.npmjs.org/@eslint%2fcreate-config 2465ms (cache revalidated)
30 timing arborist:ctor Completed in 1ms
31 timing arborist:ctor Completed in 0ms
32 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/acorn-jsx
33 timing command:init Completed in 2618ms
34 verbose stack Error: command failed
34 verbose stack     at ChildProcess.<anonymous> (C:\Users\sakth\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
34 verbose stack     at ChildProcess.emit (node:events:520:28)
34 verbose stack     at maybeClose (node:internal/child_process:1092:16)
34 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
35 verbose cwd D:\Projects
36 verbose Windows_NT 10.0.19044
37 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sakth\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "init" "@eslint/config"
38 verbose node v16.14.0
39 verbose npm  v8.5.3
40 error code 1
41 error path D:\Projects
42 error command failed
43 error command C:\Windows\system32\cmd.exe /d /s /c create-config
44 verbose exit 1
45 timing npm Completed in 3315ms
46 verbose code 1
47 error A complete log of this run can be found in:
47 error     C:\Users\sakth\AppData\Local\npm-cache\_logs\2022-03-08T16_30_49_917Z-debug-0.log

And for npx create-react-app .

'create-react-app' is not recognized as an internal or external command,
operable program or batch file.


Solution 1:[1]

are you using the newer npx command for create-react-app? from the docs :

npx create-react-app my-app cd my-app npm start

If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Scott Fraser