npm run dev execution webpack error, My webpack is newly installed - javascript

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.

Related

react npm run build command failed and gives error Failed to compile. Maximum call stack size exceeded

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 ]

How do I resolve "npm run babel" error in VS code?

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 ]

Lerna doesn't start webpack

I have a webpack.config.js in my root directory (outside the directory that contains the packages*.json files) and when I start lerna run build then I have this error:
**ERROR OUTPUT**
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.7.0
3 info using node#v11.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle access-ninja#1.0.0~prebuild: access-ninja#1.0.0
6 info lifecycle access-ninja#1.0.0~build: access-ninja#1.0.0
7 verbose lifecycle access-ninja#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle access-ninja#1.0.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/user/dev/development/6.3_sources/portal-ui/react/packages/access-ninja/node_modules/.bin:/home/user/dev/development/6.3_sources/portal-ui/react/packages/access-ninja/node_modules/.bin:/home/user/dev/development/6.3_sources/portal-ui/react/packages/node_modules/.bin:/home/user/dev/development/6.3_sources/portal-ui/react/node_modules/.bin:/home/user/dev/development/6.3_sources/portal-ui/node_modules/.bin:/home/user/dev/development/6.3_sources/node_modules/.bin:/home/user/dev/development/node_modules/.bin:/home/user/dev/node_modules/.bin:/home/user/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/bin:/home/user/bin/Sencha/Cmd:/home/user/bin:/home/user/.local/bin:/opt/maven-3.5.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle access-ninja#1.0.0~build: CWD: /home/user/dev/development/6.3_sources/portal-ui/react/packages/access-ninja
10 silly lifecycle access-ninja#1.0.0~build: Args: [ '-c', 'webpack --progress --mode development' ]
11 silly lifecycle access-ninja#1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle access-ninja#1.0.0~build: Failed to exec build script
13 verbose stack Error: access-ninja#1.0.0 build: `webpack --progress --mode development`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:193:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:193:13)
13 verbose stack at maybeClose (internal/child_process.js:1001:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
14 verbose pkgid access-ninja#1.0.0
15 verbose cwd /home/user/dev/development/6.3_sources/portal-ui/react/packages/access-ninja
16 verbose Linux 4.18.0-16-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v11.13.0
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error access-ninja#1.0.0 build: `webpack --progress --mode development`
22 error Exit status 1
23 error Failed at the access-ninja#1.0.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 ]
This is the structure in my monorepo:
packages/
├── portal-ui
│ └── package.json
├── access-ninja
└── package.json
I see that webpack starts, but I don't know what it needs to work
You probably need to add the --config parameter to defined where the build script is, because now it's looking inside the package folder.
"build": "webpack --config ../../webpack.config.js --progress --mode development"

Cannot read property 'thisCompilation' of undefined - react-scripts-ts

I created a new project, totally blank using these instructions:
https://developer.microsoft.com/en-us/fabric#/get-started
Follow steps 1-4
The application works fine.
Once I run npm i webpack
Then I get this error
my package.json
{
"name": "lulo",
"version": "0.1.0",
"private": true,
"dependencies": {
"office-ui-fabric-react": "^6.157.0",
"react": "^16.8.4",
"react-adal": "^0.4.22",
"react-dom": "^16.8.4",
"react-scripts-ts": "3.1.0",
"redux": "^4.0.1"
},
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"devDependencies": {
"#types/jest": "^24.0.11",
"#types/node": "^11.11.3",
"#types/react": "^16.8.8",
"#types/react-adal": "^0.4.1",
"#types/react-dom": "^16.8.2",
"typescript": "^3.3.3333",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0"
}
}
the error is this:
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
Failed to compile.
Cannot read property 'thisCompilation' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lulo#0.1.0 build: `react-scripts-ts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lulo#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! /Users/luisvalencia/.npm/_logs/2019-03-19T21_18_01_997Z-debug.log
and the log file has this
0 info it worked if it ends with ok
1 verbose cli [ '/Users/x/.nvm/versions/node/v10.0.0/bin/node',
1 verbose cli '/Users/x/.nvm/versions/node/v10.0.0/bin/npm',
1 verbose cli 'run-script',
1 verbose cli 'build' ]
2 info using npm#5.6.0
3 info using node#v10.0.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle lulo#0.1.0~prebuild: lulo#0.1.0
6 info lifecycle lulo#0.1.0~build: lulo#0.1.0
7 verbose lifecycle lulo#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle lulo#0.1.0~build: PATH: /Users/x/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/x/Lulo/lulo/node_modules/.bin:/Users/x/.nvm/versions/node/v10.0.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle lulo#0.1.0~build: CWD: /Users/x/Lulo/lulo
10 silly lifecycle lulo#0.1.0~build: Args: [ '-c', 'react-scripts-ts build' ]
11 silly lifecycle lulo#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle lulo#0.1.0~build: Failed to exec build script
13 verbose stack Error: lulo#0.1.0 build: `react-scripts-ts build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/Users/x/.nvm/versions/node/v10.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/Users/x/.nvm/versions/node/v10.0.0/lib/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:947:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
14 verbose pkgid lulo#0.1.0
15 verbose cwd /Users/luisvalencia/Lulo/lulo
16 verbose Darwin 18.0.0
17 verbose argv "/Users/x/.nvm/versions/node/v10.0.0/bin/node" "/Users/x/.nvm/versions/node/v10.0.0/bin/npm" "run-script" "build"
18 verbose node v10.0.0
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error lulo#0.1.0 build: `react-scripts-ts build`
22 error Exit status 1
23 error Failed at the lulo#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 ]
This thread has the answer:
https://github.com/facebook/create-react-app/issues/4076
Basically, delete node_modules and remove webpack from package.json dependencies, then npm install. Some people resolved by using yarn instead of npm.
I too struggled to resolve this error for quite sometime. The problem in my case was due to transitive dependency. Although, "webpack" was not explicitly mentioned as dependency in my project package.json, I found 2 versions of "webpack" in package-lock.json. One was used by "react-scripts" and other by "react-nbsp", which I had mentioned as dependency in package.json, and was using it to get non breaking space in React JSX.
I removed "react-nbsp" from package.json, deleted node-modules, package-lock.json and ran the application. It started without error and worked fine.

Error while compiling the project with npm

I am trying to get a project running and when I execute the npm install it installs all the dependencies.
But after that I try to execute npm run compile and it gives me an error.
Here is the log file for better understanding the error.
0 info it worked if it ends with ok
1 verbose cli [ '/Users/roxhens/.nvm/versions/node/v10.13.0/bin/node',
1 verbose cli '/Users/roxhens/.nvm/versions/node/v10.13.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm#6.4.1
3 info using node#v10.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle jsonforms-tooling-common#0.0.1~prebuild: jsonforms-tooling-common#0.0.1
6 info lifecycle jsonforms-tooling-common#0.0.1~build: jsonforms-tooling-common#0.0.1
7 verbose lifecycle jsonforms-tooling-common#0.0.1~build: unsafe-perm in lifecycle true
8 verbose lifecycle jsonforms-tooling-common#0.0.1~build: PATH: /Users/roxhens/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common/node_modules/.bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common/node_modules/.bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/node_modules/.bin:/Users/roxhens/Desktop/GitHub/node_modules/.bin:/Users/roxhens/Desktop/node_modules/.bin:/Users/roxhens/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/roxhens/.nvm/versions/node/v10.13.0/bin:/Users/roxhens/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/node_modules/.bin:/Users/roxhens/.nvm/versions/node/v10.13.0/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin
9 verbose lifecycle jsonforms-tooling-common#0.0.1~build: CWD: /Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common
10 silly lifecycle jsonforms-tooling-common#0.0.1~build: Args: [ '-c', 'npm run compile' ]
11 silly lifecycle jsonforms-tooling-common#0.0.1~build: Returned: code: 2 signal: null
12 info lifecycle jsonforms-tooling-common#0.0.1~build: Failed to exec build script
13 verbose stack Error: jsonforms-tooling-common#0.0.1 build: `npm run compile`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/Users/roxhens/.nvm/versions/node/v10.13.0/lib/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> (/Users/roxhens/.nvm/versions/node/v10.13.0/lib/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 jsonforms-tooling-common#0.0.1
15 verbose cwd /Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common
16 verbose Darwin 18.2.0
17 verbose argv "/Users/roxhens/.nvm/versions/node/v10.13.0/bin/node" "/Users/roxhens/.nvm/versions/node/v10.13.0/bin/npm" "run" "build"
18 verbose node v10.13.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error jsonforms-tooling-common#0.0.1 build: `npm run compile`
22 error Exit status 2
23 error Failed at the jsonforms-tooling-common#0.0.1 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
This is the package.json in the project root directory.
{
"scripts": {
"lerna": "lerna",
"coveralls": "ts-jest --coverage && cat ./tests/coverage/lcov.info | coveralls",
"postinstall": "npm run lernabootstrap && npm run lernainstall",
"lernainstall": "lerna exec --no-bail --npm-ci-mode -- npm run custominstall",
"lernabootstrap": "lerna bootstrap --npm-ci-mode --ignore-scripts",
"compile": "lerna run build",
"lint": "lerna run lint"
},
"devDependencies": {
"#types/jest": "^23.3.11",
"#types/node": "^10.12.10",
"coveralls": "^3.0.2",
"jest": "^23.6.0",
"lerna": "^3.4.3",
"rimraf": "2.6.3",
"ts-jest": "^23.10.4",
"tslint": "^5.11.0",
"tslint-react": "^3.6.0",
"typescript": "^3.1.6",
"vscode": "^1.1.21"
},
"dependencies": {
"#jsonforms/core": "^2.0.12",
"simple-git": "^1.107.0"
}
}
I guess that you're trying to build the following:
https://github.com/eclipsesource/jsonforms-tooling
When trying to build libraries found on GitHub (or elsewhere), you can look at how they build it on their CI or look at some other scripts. It seems that for this particular lib, their .travis.yml does not contain everything to make it work on all platforms.
I fiddled with it for a bit and running these (rather straightforward) commands from the root folder should solve your problem:
git clone https://github.com/eclipsesource/jsonforms-tooling
cd jsonforms-tooling
npm install
npm run compile
I still cannot find the reason why that error, but I managed to fix it by deleting the files and cloning the repository again.

Categories

Resources