What am trying to do is convert modern javascript code to old code using babel.
When I hit enter on "node_modules/.bin/babel src/index.js -o dizt/azzetz/bundle.js", it works but when I include it in the package.json file then hit enter on "npm run babel" in the terminal it doesn't work.
This is the scripts object inside my "package.json" file.
"scripts": {
"babel": "node_modules/.bin/babel src/index.js -o dizt/azzetz/bundle.js"
}
When I hit enter on "npm run babel" in the terminal, I get this error below.
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 61#1.0.0 babel 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-12-06T08_05_12_938Z-debug.log
This is my .babelrc config file.
{
"presets": ["#babel/preset-env"]
}
This is what the log file looks like.
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 'run',
1 verbose cli 'babel'
1 verbose cli ]
2 info using npm#6.14.8
3 info using node#v14.15.0
4 verbose run-script [ 'prebabel', 'babel', 'postbabel' ]
5 info lifecycle 61#1.0.0~prebabel: 61#1.0.0
6 info lifecycle 61#1.0.0~babel: 61#1.0.0
7 verbose lifecycle 61#1.0.0~babel: unsafe-perm in lifecycle true
8 verbose lifecycle 61#1.0.0~babel: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\user\Documents\ninja\19. Modern Workflow with Babel & Webpack\61\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\user\AppData\Local\Microsoft\WindowsApps;;C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\user\AppData\Roaming\npm
9 verbose lifecycle 61#1.0.0~babel: CWD: C:\Users\user\Documents\ninja\19. Modern Workflow with Babel & Webpack\61
10 silly lifecycle 61#1.0.0~babel: Args: [ '/d /s /c', 'babel src/index.js -o dizt/azzetz/bundle.js' ]
11 silly lifecycle 61#1.0.0~babel: Returned: code: 1 signal: null
12 info lifecycle 61#1.0.0~babel: Failed to exec babel script
13 verbose stack Error: 61#1.0.0 babel: `babel src/index.js -o dizt/azzetz/bundle.js`
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:315: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: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 61#1.0.0
15 verbose cwd C:\Users\user\Documents\ninja\19. Modern Workflow with Babel & Webpack\61
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "babel"
18 verbose node v14.15.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error 61#1.0.0 babel: `babel src/index.js -o dizt/azzetz/bundle.js`
22 error Exit status 1
23 error Failed at the 61#1.0.0 babel script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Related
I am creating production build where I am facing this issue while running command npm run build. it gives me below error
While I tried to increase heap size by adding this line --max_old_space_size=4096 to the build in the package.json.
I also tried to remove node_modules and then clear cache and install node_modules again but it still failed.
Note -> application running in development mode no error no issue at all.
Node version v14.17.3 npm version 6.14.13
Creating an optimized production build...
Failed to compile.
Maximum call stack size exceeded
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 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\MySystem\AppData\Roaming\npm-cache\_logs\2022-09-08T10_32_42_442Z-debug.log
C:\Users\MySystem\AppData\Roaming\npm-cache_logs\2022-09-08T10_32_42_442Z-debug.log
Below are this url logs
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 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.13
3 info using node#v14.17.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-app#0.1.0~prebuild: my-app#0.1.0
6 info lifecycle my-app#0.1.0~build: my-app#0.1.0
7 verbose lifecycle my-app#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-app#0.1.0~build: PATH: C:\Users\MySystem\AppData\Roaming\nvm\v14.17.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\MySystem\Documents\project\televisit-main\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Users\MySystem\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\MySystem\AppData\Local\Microsoft\WindowsApps;C:\Users\MySystem\AppData\Roaming\npm;C:\Users\MySystem\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\MySystem\AppData\Local\GitHubDesktop\bin;C:\Program Files\JetBrains\WebStorm 2022.1\bin;;C:\Program Files\Azure Data Studio\bin;C:\Users\MySystem\AppData\Roaming\nvm;C:\Program Files\nodejs
9 verbose lifecycle my-app#0.1.0~build: CWD: C:\Users\MySystem\Documents\project\televisit-main
10 silly lifecycle my-app#0.1.0~build: Args: [ '/d /s /c', 'react-scripts build' ]
11 silly lifecycle my-app#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle my-app#0.1.0~build: Failed to exec build script
13 verbose stack Error: my-app#0.1.0 build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\MySystem\AppData\Roaming\nvm\v14.17.3\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:375:28)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\MySystem\AppData\Roaming\nvm\v14.17.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:375:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid my-app#0.1.0
15 verbose cwd C:\Users\MySystem\Documents\project\televisit-main
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.17.3
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 1
22 error my-app#0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the my-app#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 ]
Couldn't find any solution that worked online so asking here, I am a bit of a noob in web development and using npm and such.
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:\\Program Files\\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.13
3 info using node#v14.17.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle vue-crash#0.1.0~prebuild: vue-crash#0.1.0
6 info lifecycle vue-crash#0.1.0~build: vue-crash#0.1.0
7 verbose lifecycle vue-crash#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle vue-crash#0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\D_Documents\Web_dev\vue-crash\node_modules\.bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\D_Programs\Git\cmd;C:\Program Files (x86)\dotnet\;C:\ffmpeg\bin;C:\Program Files\Tesseract-OCR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\peter\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\peter\AppData\Local\Programs\Python\Python38-32\;C:\Users\peter\AppData\Local\Microsoft\WindowsApps;D:\D_Programs\MikTeX\miktex\bin\x64\;C:\Users\peter\AppData\Local\Programs\Microsoft VS Code\bin;C:\ffmpeg\bin;C:\Users\peter\AppData\Roaming\Amazon;C:\Program Files\Unity\Hub\Editor\2019.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin;C:\Users\peter\AppData\Roaming\npm
9 verbose lifecycle vue-crash#0.1.0~build: CWD: D:\D_Documents\Web_dev\vue-crash
10 silly lifecycle vue-crash#0.1.0~build: Args: [ '/d /s /c', 'vue-cli-service build' ]
11 silly lifecycle vue-crash#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle vue-crash#0.1.0~build: Failed to exec build script
13 verbose stack Error: vue-crash#0.1.0 build: `vue-cli-service build`
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:376: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:376:20)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid vue-crash#0.1.0
15 verbose cwd D:\D_Documents\Web_dev\vue-crash
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.17.0
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 1
22 error vue-crash#0.1.0 build: `vue-cli-service build`
22 error Exit status 1
23 error Failed at the vue-crash#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 ]
npm --versions :
npm: '6.14.13',
ares: '1.17.1',
brotli: '1.0.9',
cldr: '38.1',
icu: '68.2',
llhttp: '2.1.3',
modules: '83',
napi: '8',
nghttp2: '1.42.0',
node: '14.17.0',
openssl: '1.1.1k',
tz: '2020d',
unicode: '13.0',
uv: '1.41.0',
v8: '8.4.371.23-node.63',
zlib: '1.2.11'
Already tried deleting node_modules and package-lock.json and running npm install. If you have any idea it would be greatly appreciated since I have no idea where to start.
My webpack is just installed, the following is my project environment:
webpack.config.js
const path = require('path')
module.exports = {
// 打包模式
mode: "development",
// 打包入口文件
entry: path.join(__dirname, './src/index.js'),
output: {
// 输出文件路径
path: path.join(__dirname, './dist'),
// 输出文件名称
filename: 'bundle.js'
}
}
package.json
{
"name": "test_webpack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
}
}
Execute npm run dev, Output the following
λ npm run dev
> test_webpack#1.0.0 dev D:\WWW\test_webpack
> webpack
#
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#
#
#FailureMessage Object: 000000A5D21ECF70npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! test_webpack#1.0.0 dev: `webpack`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the test_webpack#1.0.0 dev 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\cangs\AppData\Roaming\npm-cache\_logs\2019-11-19T07_20_00_087Z-debug.log
C:\Users\cangs\AppData\Roaming\npm-cache_logs\2019-11-19T07_20_00_087Z-debug.log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using npm#6.9.0
3 info using node#v12.0.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle test_webpack#1.0.0~predev: test_webpack#1.0.0
6 info lifecycle test_webpack#1.0.0~dev: test_webpack#1.0.0
7 verbose lifecycle test_webpack#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle test_webpack#1.0.0~dev: PATH: D:\Users\cangs\AppData\Roaming\nvm\v12.0.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\WWW\test_webpack\node_modules\.bin;D:\Users\cangs\AppData\Roaming\cmder\bin;D:\Users\cangs\AppData\Roaming\cmder\vendor\bin;D:\Users\cangs\AppData\Roaming\cmder\vendor\conemu-maximus5\ConEmu\Scripts;D:\Users\cangs\AppData\Roaming\cmder\vendor\conemu-maximus5;D:\Users\cangs\AppData\Roaming\cmder\vendor\conemu-maximus5\ConEmu;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Program Files\Microsoft VS Code\bin;D:\Program Files (x86)\Tencent\QQ\Bin;D:\Program Files\PremiumSoft\Navicat Premium 12;D:\Users\cangs\AppData\Roaming\ffmpeg\bin;D:\Users\cangs\AppData\Roaming\cmder;D:\Users\cangs\AppData\Roaming\nvm;D:\Program Files\nodejs;D:\Users\cangs\AppData\Local\Programs\Python\Python37\Scripts\;D:\Users\cangs\AppData\Local\Programs\Python\Python37\;C:\Users\cangs\AppData\Local\Microsoft\WindowsApps;D:\Program Files\JetBrains\PhpStorm 2019.2.5\bin;C:\Program Files\Bandizip\;D:\Program Files\JetBrains\PyCharm 2019.2.4\bin;D:\Users\cangs\AppData\Roaming\nvm;D:\Program Files\nodejs;D:\Users\cangs\AppData\Roaming\cmder\vendor\git-for-windows\cmd;D:\Users\cangs\AppData\Roaming\cmder\vendor\git-for-windows\mingw64\bin;D:\Users\cangs\AppData\Roaming\cmder\vendor\git-for-windows\usr\bin;D:\Users\cangs\AppData\Roaming\cmder
9 verbose lifecycle test_webpack#1.0.0~dev: CWD: D:\WWW\test_webpack
10 silly lifecycle test_webpack#1.0.0~dev: Args: [ '/d /s /c', 'webpack' ]
11 silly lifecycle test_webpack#1.0.0~dev: Returned: code: 3221225477 signal: null
12 info lifecycle test_webpack#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: test_webpack#1.0.0 dev: `webpack`
13 verbose stack Exit status 3221225477
13 verbose stack at EventEmitter.<anonymous> (D:\Users\cangs\AppData\Roaming\nvm\v12.0.0\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:196:13)
13 verbose stack at ChildProcess.<anonymous> (D:\Users\cangs\AppData\Roaming\nvm\v12.0.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:196:13)
13 verbose stack at maybeClose (internal/child_process.js:1000:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
14 verbose pkgid test_webpack#1.0.0
15 verbose cwd D:\WWW\test_webpack
16 verbose Windows_NT 10.0.17763
17 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v12.0.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 3221225477
22 error test_webpack#1.0.0 dev: `webpack`
22 error Exit status 3221225477
23 error Failed at the test_webpack#1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]
But execute node_modules/.bin/webpack is allowed
λ node_modules\.bin\webpack
#
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#
#
#FailureMessage Object: 000000A3F1AFD030
I can't know the way to solve the error from the error message output. I hope that more experienced people can help me.
In an effort to remove gulp from my project, I'm refactoring all of my scripts into node scripts. This has been largely successful, however, in refactoring my JSHint scripts, I'm running into a peculiar (though largely benign) problem. My script in package.json is:
"jshint-script": "jshint --reporter=tasks/misc_tasks/jshint.js build/ --exclude build-/libs/"
This works absolutely fine when I type it directly into the command line. However, when I run npm run jshint-script, everything runs just fine, but then an error is blown.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! Rosetta#5.0.0 jshint-script:jshint --reporter=tasks/misc_tasks/reporter.js build-ts/ --exclude build/libs/
npm ERR! Exit status 2
the full log is below:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'jshint' ]
2 info using npm#6.9.0
3 info using node#v10.16.0
4 verbose run-script [ 'prejshint', 'jshint', 'postjshint' ]
5 info lifecycle Project#5.0.0~prejshint: Project#5.0.0
6 info lifecycle Project#5.0.0~jshint: Project#5.0.0
7 verbose lifecycle Project#5.0.0~jshint: unsafe-perm in lifecycle true
8 verbose lifecycle Project#5.0.0~jshint: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/user/Documents/Git/Project/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/opt/openssl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/opt/openssl/bin:/Users/user/npm/bin:/Users/user/npm/bin
9 verbose lifecycle Project#5.0.0~jshint: CWD: /Users/user/Documents/Git/Project
10 silly lifecycle Project#5.0.0~jshint: Args: [ '-c',
10 silly lifecycle 'jshint --reporter=tasks/misc_tasks/jshint.js build/ --exclude build/libs/' ]
11 silly lifecycle Project#5.0.0~jshint: Returned: code: 2 signal: null
12 info lifecycle Project#5.0.0~jshint: Failed to exec jshint script
13 verbose stack Error: Project#5.0.0 jshint:jshint --reporter=tasks/misc_tasks/jshint.js build/ --exclude build/libs/
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
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: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 Project#5.0.0
15 verbose cwd /Users/user/Documents/Git/Project
16 verbose Darwin 18.2.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "jshint"
18 verbose node v10.16.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 2
22 error Project#5.0.0 jshint:jshint --reporter=tasks/misc_tasks/jshint.js build/ --exclude build/libs/
22 error Exit status 2
23 error Failed at the Project#5.0.0 jshint script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
Disclaimer before reading: I am new to coding so I hope that I won't be judged too harshly. Anyway, this is what happens right after I run npm-start from my react application root directory:
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
I tried resetting my path variables to point to npm on my windows 7 machine, and still no luck. I've additionally tried reinstalling npm in my react project root and re-configuring my react-scripts dev dependency in the package.json file. Additionally, I've tested this with yarn start, and it still does not work.
Below is a full error log from Users/MyName/AppData/Roaming/npm-cache/some-text-file-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Mara\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#6.5.0
3 info using node#v10.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle app-one#0.1.0~prestart: app-one#0.1.0
6 info lifecycle app-one#0.1.0~start: app-one#0.1.0
7 verbose lifecycle app-one#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle app-one#0.1.0~start: PATH: C:\Users\Mara\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Mara\documents\myprograms\app-one\node_modules\.bin;C:\Users\Mara\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Mara\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\C;C:\Program Files\Git\Program Files\Java\jdk1.8.0_144\bin\C;C:\Program Files\Git\Program Files (x86)\Skype\Phone;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\MongoDB\Server\3.4\bin;C:\Program Files (x86)\Yarn\bin;C:\Program Files\Lenovo\Fingerprint Manager Pro;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\php;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\nodejs;C:\Users\Mara\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\Mara\AppData\Local\Programs\Python\Python37;C:\Ruby25-x64\bin;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Users\Mara\AppData\Local\atom\bin;C:\Users\Mara\Downloads\python-3.7.3.exe;C:\C;C:\Program Files\Git\Program Files\Heroku\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\Mara\AppData\Local\Yarn\bin;C:\Ruby\bin;C\php;C\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\Mara\AppData\Roaming\npm;C:\Users\Mara\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle app-one#0.1.0~start: CWD: C:\Users\Mara\documents\myprograms\app-one
10 silly lifecycle app-one#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle app-one#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle app-one#0.1.0~start: Failed to exec start script
13 verbose stack Error: app-one#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Mara\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Mara\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid app-one#0.1.0
15 verbose cwd C:\Users\Mara\documents\myprograms\app-one
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mara\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.15.0
19 verbose npm v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error app-one#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the app-one#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 ]```
It seems the task is trying to call require('child_process'). spawn directly since Windows requires a file extension in order for Node.js to spawn the binary. In this case, you can refer to npm-execspawn for more information.
Also, refer to this post