I make a react app using the command "npx create-react-app" and I try to start the development server without doing any changes to it using "npm start" and it ends with this error
picture: https://i.stack.imgur.com/r28sS.png
and this is the log file
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 'start'
0 verbose cli ]
1 info using npm#8.1.0
2 info using node#v16.13.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:T:\t\Projects\React.js\.npmrc Completed in 1ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:C:\Users\thevi\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\thevi\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
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 npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 4ms
23 timing npm:load:cleanupLog Completed in 7ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 1ms
26 timing npm:load Completed in 31ms
27 timing command:run-script Completed in 3ms
28 timing command:start Completed in 16ms
29 verbose stack Error: ENOENT: no such file or directory, open 'T:\t\Projects\React.js\package.json'
30 verbose cwd T:\t\Projects\React.js
31 verbose Windows_NT 10.0.22000
32 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
33 verbose node v16.13.0
34 verbose npm v8.1.0
35 error code ENOENT
36 error syscall open
37 error path T:\t\Projects\React.js/package.json
38 error errno -4058
39 error enoent ENOENT: no such file or directory, open 'T:\t\Projects\React.js\package.json'
40 error enoent This is related to npm not being able to find a file.
41 verbose exit -4058
You should first go to your project directory, in your case it is called anatha_1.
So, run cd anatha_1, then npm start.
npm start or any other npm script, looks for the package.json file in the current working directory.
It is also what is written by create-react-app at the end of its output, so please follow the guidelines.
Related
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 npm#8.5.3
2 info using node#v16.14.0
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.
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.
When I try to npm install or npm install, I see "Cannot read properties of null (reading 'edgesOut')" and I have package.json I add screenshots, please help me, thanks a lot.
And that's my error 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 'install',
0 verbose cli 'react-scripts'
0 verbose cli ]
1 info using npm#8.1.2
2 info using node#v16.13.1
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
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 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\muhammed.eviz\Desktop\HAKİM\hakim-ui\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\muhammed.eviz\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\muhammed.eviz\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 0ms
18 timing config:load Completed in 7ms
19 timing npm:load:configload Completed in 7ms
20 timing npm:load:setTitle Completed in 1ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 2ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 1ms
26 timing npm:load Completed in 13ms
27 timing arborist:ctor Completed in 0ms
28 timing arborist:ctor Completed in 0ms
29 timing idealTree:init Completed in 10ms
30 timing idealTree:userRequests Completed in 2ms
31 silly idealTree buildDeps
32 silly fetch manifest #reduxjs/toolkit#^1.6.2
33 http fetch GET 200 https://registry.npmjs.org/#reduxjs%2ftoolkit 444ms (cache revalidated)
34 timing idealTree Completed in 464ms
35 timing command:install Completed in 478ms
36 verbose stack TypeError: Cannot read properties of null (reading 'edgesOut')
36 verbose stack at Arborist.[loadPeerSet] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1282:38)
36 verbose stack at Arborist.[nodeFromEdge] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:1103:30)
36 verbose stack at async Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:930:11)
36 verbose stack at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\build-ideal-tree.js:216:7)
36 verbose stack at async Promise.all (index 1)
36 verbose stack at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\reify.js:149:5)
36 verbose stack at async Install.install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:170:5)
37 verbose cwd C:\Users\muhammed.eviz\Desktop\HAKİM\hakim-ui
38 verbose Windows_NT 10.0.19042
39 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-scripts"
40 verbose node v16.13.1
41 verbose npm v8.1.2
42 error Cannot read properties of null (reading 'edgesOut')
43 verbose exit 1`
error screenshot1 - when npm install
error screenshot2 - when npm install
my folder structure
If you try to install some packages to a project path which has non-Unicode characters like the following in the path's name
ÇŞİĞÜæÂÊ...
you will get errors.
The below path will work if you try to install packages here.
C:\Users\andrew\project
But this path will not work because it has Unicode in its name.
C:\Users\ândrew\project
EDIT: The best way of solve this problem is using memory card. (Like C:, D:, F:...)
So I begin by running git clone http://...........
and it downloads the project successfully
Then I run cd to change directories. That works!
I run npm install in the directory and the following errors are displayed in the cmd line
npm ERR! code EJSONPARSE
npm ERR! path C:\Users\Home\Documents\Ctr-Alt-Elite/package.json
npm ERR! JSON.parse Unexpected token "<" (0x3C) in JSON at position 625 while parsing near "...us-bar\": \"~1.1.0\",\r\n<<<<<<< HEAD\r\n \"f..."
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Home\AppData\Local\npm-cache\_logs\2021-12-08T17_53_50_035Z-debug.log
Below is the debug.log file
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 'start'
0 verbose cli ]
1 info using npm#8.1.2
2 info using node#v16.13.1
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 9ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Home\Documents\Ctr-Alt-Elite\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\Home\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\Home\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 2ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 21ms
19 timing npm:load:configload Completed in 22ms
20 timing npm:load:setTitle Completed in 1ms
21 timing npm:load:setupLog Completed in 1ms
22 timing config:load:flatten Completed in 4ms
23 timing npm:load:cleanupLog Completed in 6ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 7ms
26 timing npm:load Completed in 52ms
27 timing command:run-script Completed in 8ms
28 timing command:start Completed in 26ms
29 verbose stack JSONParseError: Unexpected token "<" (0x3C) in JSON at position 625 while parsing near "...us-bar\": \"~1.1.0\",\r\n<<<<<<< HEAD\r\n \"f..."
29 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json-fast\index.js:11:61
29 verbose stack at async RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:87:19)
30 verbose cwd C:\Users\Home\Documents\Ctr-Alt-Elite
31 verbose Windows_NT 10.0.19043
32 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
33 verbose node v16.13.1
34 verbose npm v8.1.2
35 error code EJSONPARSE
36 error path C:\Users\Home\Documents\Ctr-Alt-Elite/package.json
37 error JSON.parse Unexpected token "<" (0x3C) in JSON at position 625 while parsing near "...us-bar\": \"~1.1.0\",\r\n<<<<<<< HEAD\r\n \"f..."
38 error JSON.parse Failed to parse JSON data.
38 error JSON.parse Note: package.json must be actual JSON, not just JavaScript.
39 verbose exit 1
Looks like someone committed a merge conflict in package.json, making the JSON invalid. To fix the issue, go to package.json and resolve the conflict. Here is an article explaining all you need about merging manually. The gist of it is that a conflict looks like this:
<<<<<<< HEAD
// Here is the code for your version/branch
=======
// Here is the version from the version/branch you're merging in
>>>>>>> <branch-/tagname or commitref>
Then you need to manually decide what should be kept from the two versions, and of course, remove the markers.
Working on an electron project (im not very good with node.js) and am getting this same parsing error every time I run. I'm not sure how to fix it because this is my first time using electron for html.
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 'start'
0 verbose cli ]
1 info using npm#8.1.0
2 info using node#v17.0.0
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 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Administrator\electron-quick-start\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\Administrator\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\Administrator\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 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing config:load:flatten Completed in 4ms
23 timing npm:load:cleanupLog Completed in 3ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 1ms
26 timing npm:load Completed in 23ms
27 timing command:run-script Completed in 6ms
28 timing command:start Completed in 13ms
29 verbose stack JSONParseError: Unexpected string in JSON at position 238 while parsing '{
29 verbose stack "name": "uswl",
29 verbose stack "version": "1.0.0"'
29 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json-fast\index.js:11:61
29 verbose stack at async RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:87:19)
30 verbose cwd C:\Users\Administrator\electron-quick-start
31 verbose Windows_NT 10.0.19042
32 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
33 verbose node v17.0.0
34 verbose npm v8.1.0
35 error code EJSONPARSE
36 error path C:\Users\Administrator\electron-quick-start/package.json
37 error JSON.parse Unexpected string in JSON at position 238 while parsing '{
37 error JSON.parse "name": "uswl",
37 error JSON.parse "version": "1.0.0"'
38 error JSON.parse Failed to parse JSON data.
38 error JSON.parse Note: package.json must be actual JSON, not just JavaScript.
39 verbose exit 1```
I'm trying to deploy my local react app to GitHub pages following these instructions: https://blog.logrocket.com/8-ways-to-deploy-a-react-app-for-free/
I added the scripts to packages.json as indicated, but when I go to npm run deploy, I get this error:
MBP roo % npm run deploy
npm ERR! Missing script: "deploy"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/reallymemorable/.npm/_logs/2021-10-26T15_38_56_012Z-debug.log
I even went ahead and ran npm install deploy just in case (even though it was indicated in the tutorial).
Same error.
This is what in the log file when I cat it:
MBP roo % cat /Users/reallymemorable/.npm/_logs/2021-10-26T15_38_56_012Z-debug.log
0 verbose cli [
0 verbose cli '/opt/homebrew/Cellar/node/17.0.1/bin/node',
0 verbose cli '/opt/homebrew/bin/npm',
0 verbose cli 'run',
0 verbose cli 'deploy'
0 verbose cli ]
1 info using npm#8.1.0
2 info using node#v17.0.1
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/Users/reallymemorable/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 0ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 5ms
18 timing npm:load:configload Completed in 5ms
19 timing npm:load:setTitle Completed in 2ms
20 timing npm:load:setupLog Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:cleanupLog Completed in 1ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 1ms
25 timing npm:load Completed in 11ms
26 timing command:run-script Completed in 4ms
27 verbose stack Error: Missing script: "deploy"
27 verbose stack
27 verbose stack To see a list of scripts, run:
27 verbose stack npm run
27 verbose stack at RunScript.run (/opt/homebrew/lib/node_modules/npm/lib/run-script.js:105:13)
28 verbose cwd /Users/reallymemorable/git/roo
29 verbose Darwin 20.6.0
30 verbose argv "/opt/homebrew/Cellar/node/17.0.1/bin/node" "/opt/homebrew/bin/npm" "run" "deploy"
31 verbose node v17.0.1
32 verbose npm v8.1.0
33 error Missing script: "deploy"
33 error
33 error To see a list of scripts, run:
33 error npm run
34 verbose exit 1
How can I get access to the deploy script? Does this have something to do with my node version? (I installed it with brew install node, so I have the latest version.)
Problem solved. I was not cded into the right directory when I ran the command...