In my React create-react-app projects npm start is working fine, but the 'build' script fails almost immediately.
The error says failed to compile - 'EISDIR: illegal operation on a directory, read'
I've tried completely uninstalling and reinstalling node & npm using nvm.
I've tried creating a new create-react-app project without editing any of preloaded code, and build still fails.
terminal error message:
Creating an optimized production build...
Failed to compile.
EISDIR: illegal operation on a directory, read
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! personal-website#0.1.0 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the personal-website#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Debug log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/Users/Stew/.nvm/versions/node/v12.7.0/bin/node',
1 verbose cli '/Users/Stew/.nvm/versions/node/v12.7.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.10.2
3 info using node#v12.7.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle personal-website#0.1.0~prebuild: personal-website#0.1.0
6 info lifecycle personal-website#0.1.0~build: personal-website#0.1.0
7 verbose lifecycle personal-website#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle personal-website#0.1.0~build: PATH: /Users/Stew/.nvm/versions/node/v12.7.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Stew/Desktop/personal-website/node_modules/.bin:/Users/Stew/.nvm/versions/node/v12.7.0/bin:/usr/bin:/usr/sbin:/bin:/sbin
9 verbose lifecycle personal-website#0.1.0~build: CWD: /Users/Stew/Desktop/personal-website
10 silly lifecycle personal-website#0.1.0~build: Args: [ '-c', 'react-scripts build' ]
11 silly lifecycle personal-website#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle personal-website#0.1.0~build: Failed to exec build script
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/Users/Stew/.nvm/versions/node/v12.7.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16)
13 verbose stack at EventEmitter.emit (events.js:203:13)
13 verbose stack at ChildProcess.<anonymous> (/Users/Stew/.nvm/versions/node/v12.7.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:203:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid personal-website#0.1.0
15 verbose cwd /Users/Stew/Desktop/personal-website
16 verbose Darwin 18.6.0
17 verbose argv "/Users/Stew/.nvm/versions/node/v12.7.0/bin/node" "/Users/Stew/.nvm/versions/node/v12.7.0/bin/npm" "run" "build"
18 verbose node v12.7.0
19 verbose npm v6.10.2
20 error code ELIFECYCLE
21 error errno 1
22 error personal-website#0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the personal-website#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
package.json
{
"name": "personal-website",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
I expect the react project to successfully compile the production build script, but instead it creates the build repository and immediate fails after creating a manifest.json and gives the error message listed above.
Related
Failed to compile.
./assets/images/cross.png
CompileError: AsyncCompile: Wasm decoding failed: mutable globals cannot be exported #+482
> Build error occurred
Error: > Build failed because of webpack errors
at nextBuildSpan.traceAsyncFn (/var/app/kv-v2/node_modules/next/dist/build/index.js:15:924)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kv-update#1.7.3 build: `next build`
npm ERR! Exit status 1
I am getting this error when trying to npm run build on my ubuntu server it was working fine previously and it is still compiling fine on my localhost windows machine so to be sure it was not due to my code I reverted to the old copy from Github that was working but its still getting the same error when compiling. I did remove the node_modules and reinstalled.
I tried Googling and there were around 10 articles of this none of them were able to fix my issue. Please help me. Thank you. This is the full log file.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm#6.14.4
3 info using node#v10.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle kv-update#1.7.3~prebuild: kv-update#1.7.3
6 info lifecycle kv-update#1.7.3~build: kv-update#1.7.3
7 verbose lifecycle kv-update#1.7.3~build: unsafe-perm in lifecycle true
8 verbose lifecycle kv-update#1.7.3~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/app/kv-v2/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle kv-update#1.7.3~build: CWD: /var/app/kv-v2
10 silly lifecycle kv-update#1.7.3~build: Args: [ '-c', 'next build' ]
11 silly lifecycle kv-update#1.7.3~build: Returned: code: 1 signal: null
12 info lifecycle kv-update#1.7.3~build: Failed to exec build script
13 verbose stack Error: kv-update#1.7.3 build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid kv-update#1.7.3
15 verbose cwd /var/app/kv-v2
16 verbose Linux 5.4.0-109-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error kv-update#1.7.3 build: `next build`
22 error Exit status 1
23 error Failed at the kv-update#1.7.3 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json file
{
"name": "kvr",
"version": "1.7.3",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p 4000",
"lint": "next lint"
},
"dependencies": {
"#notbaldrick/react-crossfade-carousel": "^1.0.4",
"babel-plugin-styled-components": "^1.13.1",
"fathom-client": "^3.1.0",
"jsonp": "^0.2.1",
"next": "11.0.1",
"npm": "^6.14.4",
"react": "17.0.2",
"react-device-detect": "^1.17.0",
"react-dom": "17.0.2",
"react-facebook-pixel": "^1.0.4",
"react-img-carousel": "^2.1.1",
"react-responsive-carousel": "^3.2.19",
"react-transition-group": "^4.4.2",
"styled-components": "^5.3.0"
},
"devDependencies": {
"babel-plugin-styled-components": "^1.13.1",
"eslint": "7.30.0",
"eslint-config-next": "11.0.1"
}
}
I did fix it by removing the cross.png file converting it to cross.jpg and updated the code everything it is importing this file. Strange bug It seems.
I recently started to learn Next/React to make a personal website, I'm trying to build a website with Next.JS, the website looks and works fine when running npm run dev, however, it's giving me an error when I try to make a build of it. I don't really understand the error, and much less how to fix it.
Thanks
Terminal Log
> portfolio# build C:\Users\Simon\Desktop\#Documents\##Projects\Coding\#web\portfolio
> next build
info - Checking validity of types
./pages/blog/[slug].js
26:17 Warning: Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags. #next/next/no-css-tags
./pages/index.js
12:9 Warning: Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags. #next/next/no-css-tags
13:9 Warning: External synchronous scripts are forbidden. See: https://nextjs.org/docs/messages/no-sync-scripts. #next/next/no-sync-scripts
23:13 Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element. #next/next/no-img-element
./components/MDXComponents.js
4:1 Warning: Assign object to a variable before exporting as module default import/no-anonymous-default-export
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info - Creating an optimized production build ...events.js:292
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'C:\Users\Simon\Desktop\#Documents\##Projects\Coding\#web\portfolio\.next\trace'
Emitted 'error' event on WriteStream instance at:
at C:\Users\Simon\Desktop\#Documents\##Projects\Coding\#web\portfolio\node_modules\next\dist\compiled\#vercel\nft\index.js:1:287421
at C:\Users\Simon\Desktop\#Documents\##Projects\Coding\#web\portfolio\node_modules\next\dist\compiled\#vercel\nft\index.js:1:287860
at FSReqCallback.oncomplete (fs.js:171:23) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'C:\\Users\\Simon\\Desktop\\#Documents\\##Projects\\Coding\\#web\\portfolio\\.next\\trace'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portfolio# build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio# build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Simon\AppData\Roaming\npm-cache\_logs\2021-11-13T12_14_00_615Z-debug.log
Log File
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Users\\Simon\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Simon\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.12
3 info using node#v14.16.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle portfolio#~prebuild: portfolio#
6 info lifecycle portfolio#~build: portfolio#
7 verbose lifecycle portfolio#~build: unsafe-perm in lifecycle true
8 verbose lifecycle portfolio#~build: PATH: // Path stuff //
9 verbose lifecycle portfolio#~build: CWD: C:\Users\Simon\Desktop\#Documents\##Projects\Coding\#web\portfolio
10 silly lifecycle portfolio#~build: Args: [ '/d /s /c', 'next build' ]
11 silly lifecycle portfolio#~build: Returned: code: 1 signal: null
12 info lifecycle portfolio#~build: Failed to exec build script
13 verbose stack Error: portfolio# build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Simon\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Simon\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid portfolio#
15 verbose cwd C:\Users\Simon\Desktop\#Documents\##Projects\Coding\#web\portfolio
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Users\\Simon\\nodejs\\node.exe" "C:\\Users\\Simon\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.16.1
19 verbose npm v6.14.12
20 error code ELIFECYCLE
21 error errno 1
22 error portfolio# build: `next build`
22 error Exit status 1
23 error Failed at the portfolio# build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
.eslintrc.json
{
"extends": "next"
}
**package.json**
{
"name": "portfolio",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.36",
"#fortawesome/free-brands-svg-icons": "^5.15.4",
"#fortawesome/free-solid-svg-icons": "^5.15.4",
"#fortawesome/react-fontawesome": "^0.1.16",
"date-fns": "^2.25.0",
"gray-matter": "^4.0.3",
"next": "12.0.3",
"next-mdx-remote": "^3.0.8",
"react": "17.0.2",
"react-dom": "17.0.2",
"sass": "^1.43.4"
},
"devDependencies": {
"eslint": "7.32.0",
"eslint-config-next": "12.0.3"
}
}
Good morning everyone, I have been having this error for 3 months and couldn't solve it
if you have any information regarding that please help.
I am running two chaincodes and 7 peers ( CA,MSP,chaincode container per peer) for a total of 42 docker containers
everything runs smoothly till it's time to do transactions, all the docker peers containing chaincode exit with this error except the first one started
I don't know if it is a hlf related error or a npm related error, and I checked everywhere, this type of error is sometimes hlf and sometimes npm, and there is no clear solution to solve it either way!
I gave up and I am asking for help now which is much appreciated as this is my graduation project
I am using hyperledger fabric v 2 and using npm,node,java script here are the contents of my package.json file
{
"name": "student-smart-contract",
"version": "1.0.0",
"description": "smart contract for courses",
"main": "index.js",
"engines": {
"node": ">=12",
"npm": ">=5"
},
"scripts": {
"init-lint": "eslint --init",
"lint": "eslint .",
"pretest": "npm run lint",
"test": "nyc mocha --recursive",
"start": "fabric-chaincode-node start"
},
"engineStrict": true,
"author": "Hyperledger",
"license": "Apache-2.0",
"dependencies": {
"ajv": "^5.5.2",
"fabric-contract-api": "^2.2.1",
"fabric-shim": "^2.2.1",
"grpc": "^1.24.5"
},
"devDependencies": {
"chai": "^4.1.2",
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"mocha": "^8.0.1",
"nyc": "^14.1.1",
"sinon": "^6.0.0",
"sinon-chai": "^3.2.0"
},
"nyc": {
"exclude": [
"coverage/**",
"test/**",
"index.js",
".eslintrc.js"
],
"reporter": [
"text-summary",
"html"
],
"all": true,
"check-coverage": true,
"statements": 100,
"branches": 100,
"functions": 100,
"lines": 100
}
}
and below is the error, thanks in advance
> Executing task: docker logs --tail 1000 -f 0f3588111617d412d11768c32df6f9f724da08c46217257953a32c90e6288d98 <
+ CHAINCODE_DIR=/usr/local/src
+ cd /usr/local/src
+ npm start -- --peer.address peer0.Aswan.com:8052
> student-smart-contract#1.0.0 start /usr/local/src
> fabric-chaincode-node start "--peer.address" "peer0.Aswan.com:8052"
2021-10-27T12:33:11.636Z info [c-api:contracts-spi/bootstrap.js] No metadata file supplied in contract, introspection will generate all the data
2021-10-27T12:33:11.643Z info [c-api:./lib/contract.js] Creating new Contract
2021-10-27T12:33:11.644Z info [c-api:./lib/contract.js] Creating new Contract
2021-10-27T12:33:11.644Z info [c-api:./lib/contract.js] Creating new Contract
2021-10-27T12:33:11.645Z info [c-api:./lib/contract.js] Creating new Contract
2021-10-27T12:33:11.645Z info [c-api:./lib/contract.js] Creating new Contract "org.hyperledger.fabric"
2021-10-27T12:33:11.712Z info [c-api:lib/chaincode.js] Registering with peer peer0.Aswan.com:8052 as chaincode "CoursesSmartContract:e2401ca75fc0abab992210baee01c0d10f4d5cbb48e701d5818772f8fda3a82a"
2021-10-27T12:33:11.727Z info [c-api:fabric-shim/cli]
Command succeeded
2021-10-27T12:33:11.774Z info [c-api:lib/handler.js] Successfully registered with peer node. State transferred to "established"
2021-10-27T12:33:11.775Z info [c-api:lib/handler.js] Successfully established communication with peer node. State transferred to "ready"
2021-10-27T12:33:41.770Z error [c-api:lib/handler.js] Received unknown message from the peer. Exiting.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! student-smart-contract#1.0.0 start: `fabric-chaincode-node start "--peer.address" "peer0.Aswan.com:8052"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the student-smart-contract#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-10-27T12_33_41_777Z-debug.log
and when I followed /root/.npm/
I got this
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start',
1 verbose cli '--',
1 verbose cli '--peer.address',
1 verbose cli 'peer0.Aswan.com:8052'
1 verbose cli ]
2 info using npm#6.13.4
3 info using node#v12.16.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle student-smart-contract#1.0.0~prestart: student-smart-contract#1.0.0
6 info lifecycle student-smart-contract#1.0.0~start: student-smart-contract#1.0.0
7 verbose lifecycle student-smart-contract#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle student-smart-contract#1.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/src/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle student-smart-contract#1.0.0~start: CWD: /usr/local/src
10 silly lifecycle student-smart-contract#1.0.0~start: Args: [
10 silly lifecycle '-c',
10 silly lifecycle 'fabric-chaincode-node start "--peer.address" "peer0.Aswan.com:8052"'
10 silly lifecycle ]
11 silly lifecycle student-smart-contract#1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle student-smart-contract#1.0.0~start: Failed to exec start script
13 verbose stack Error: student-smart-contract#1.0.0 start: `fabric-chaincode-node start "--peer.address" "peer0.Aswan.com:8052"`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:311:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:311:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid student-smart-contract#1.0.0
15 verbose cwd /usr/local/src
16 verbose Linux 5.11.0-25-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--peer.address" "peer0.Aswan.com:8052"
18 verbose node v12.16.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error student-smart-contract#1.0.0 start: `fabric-chaincode-node start "--peer.address" "peer0.Aswan.com:8052"`
22 error Exit status 1
23 error Failed at the student-smart-contract#1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I started making a project in Reactjs and i am watching a tutorial from Youtube. After creating my project using "npx create-react-app", when i try to execute "npm start" it shows a bunch of errors:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! covid-19-tracker#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the covid-19-tracker#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\VIVIDH\AppData\Roaming\npm-cache\_logs\2020-09-10T05_26_49_684Z-debug.log
npm -v = 6.14.8
node -v 14.4.0
I have tried most of the methods but it still isn't working. Here is my package.json file:
{
"name": "covid-19-tracker",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
"main": "index.js",
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/Vividh25/covid-19-tracker.git"
},
"author": "Vividh Bhardwaj",
"license": "ISC",
"bugs": {
"url": "https://github.com/Vividh25/covid-19-tracker/issues"
},
"homepage": "https://github.com/Vividh25/covid-19-tracker#readme"
}
Debug.log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\VIVIDH\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.8
3 info using node#v14.4.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle covid-19-tracker#0.1.0~prestart: covid-19-tracker#0.1.0
6 info lifecycle covid-19-tracker#0.1.0~start: covid-19-tracker#0.1.0
7 verbose lifecycle covid-19-tracker#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle covid-19-tracker#0.1.0~start: PATH: C:\Users\VIVIDH\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\VIVIDH\desktop\Projects\covid-19-tracker\node_modules\.bin;C:\Python38\Scripts\;C:\Python38\;C:\Windows\System32;D:\src\flutter\bin;C:\src\Git\cmd;C:\src\Git\cmd\git.exe;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Windows\System32\ variable;"C:\Users\VIVIDH\AppData\Local\Microsoft\WindowsApps;C:\src\Git\cmd\git.exe;C:\src\Git\cmd";D:\Microsoft VS Code\bin;C:\Users\VIVIDH\AppData\Roaming\npm
9 verbose lifecycle covid-19-tracker#0.1.0~start: CWD: C:\Users\VIVIDH\desktop\Projects\covid-19-tracker
10 silly lifecycle covid-19-tracker#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle covid-19-tracker#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle covid-19-tracker#0.1.0~start: Failed to exec start script
13 verbose stack Error: covid-19-tracker#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\VIVIDH\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\VIVIDH\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1051:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid covid-19-tracker#0.1.0
15 verbose cwd C:\Users\VIVIDH\desktop\Projects\covid-19-tracker
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\VIVIDH\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.4.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error covid-19-tracker#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the covid-19-tracker#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Please help me.
This is a problem of system variable path.
DO this.
Go to > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart.
If you're facing the same problem and have tried everything and if it still isn't working then try running the project through yarn. You can install yarn from chocolatey which comes pre-installed when you download nodejs. Here's what you type on cmd :
choco install yarn
After installation:
yarn init
To start project:
yarn create react-app <your project name>
cd <your project name>
yarn start
This worked for me, and hope it does for you :)
I'm new to node and react and am trying to start a local development server for my react app. To start it I did npm start but this put out an error. The log looks like this:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v12.16.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle myapp#0.1.0~prestart: myapp#0.1.0
6 info lifecycle myapp#0.1.0~start: myapp#0.1.0
7 verbose lifecycle myapp#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle myapp#0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\full-stack projects\react tutoral\myapp\node_modules\.bin;C:\Program Files\Git\mingw32\bin;C:\Program Files\Git\usr\bin;C:\Users\User\bin;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\PostgreSQL\10\bin;C:\Program Files\PostgreSQL\10\libC;C:\Program Files\Git\Python27;C:\Python27\scripts;C:\Users\User\AppData\Local\Programs\Python\Python37-32;C:\Users\User\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Program Files\nodejs;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\heroku\bin;C:\Users\User\AppData\Roaming\npm
9 verbose lifecycle myapp#0.1.0~start: CWD: E:\full-stack projects\react tutoral\myapp
10 silly lifecycle myapp#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle myapp#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle myapp#0.1.0~start: Failed to exec start script
13 verbose stack Error: myapp#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid myapp#0.1.0
15 verbose cwd E:\full-stack projects\react tutoral\myapp
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.3
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error myapp#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the myapp#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
How do I fix this?
EDIT
Here is the package.json for the app:
{
"name": "myapp",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
EDIT 2
I have tried all the solutions suggested, but it always shows the same errror. Here is how the error is shown in the termianl (bash):
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
←[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)←[39m
←[90m at onErrorNT (internal/child_process.js:469:16)←[39m
←[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)←[39m
Emitted 'error' event on ChildProcess instance at:
←[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)←[39m
←[90m at onErrorNT (internal/child_process.js:469:16)←[39m
←[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)←[39m {
errno: ←[32m'ENOENT'←[39m,
code: ←[32m'ENOENT'←[39m,
syscall: ←[32m'spawn cmd'←[39m,
path: ←[32m'cmd'←[39m,
spawnargs: [ ←[32m'/s'←[39m, ←[32m'/c'←[39m, ←[32m'start'←[39m, ←[32m'""'←[39m, ←[32m'/b'←[39m, ←[32m'"http://localhost:3000"'←[39m ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-05-07T16_48_16_197Z-debug.log
ignore this line. Stackoverflow requires me to describe the problem in details since most of this is code
Ok so this problem was with the Windows system32 variable. Its actually really easy to solve. Just add the following to the PATH variable:
C:\Windows\System32