상세 컨텐츠

본문 제목

windows nodejs xml2json node-gyp error 삽질기

programing/Nodejs

by ZelKun 2021. 1. 23. 01:16

본문

반응형

결론, 힘들게 삽질하지 말고 fast-xml-parser 쓰자

 

xml2json  사용하려고 하니

윈도우에서 에러를 뿜어주신다

의존성 문제인듯 한데

 

global  설치해주면 에러는 안나는듯한데

결국 프로젝트 안에서 npm install 하면 동일에러가~ 계속난다

 

PS C:\nodejs> npm install node-gyp -g

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

C:\Users\admin\AppData\Roaming\npm\node-gyp -> C:\Users\admin\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js

+ node-gyp@6.1.0

added 100 packages from 66 contributors in 28.945s

PS C:\nodejs>

 

PS C:\nodejs> npm install

 

> node-expat@2.3.18 install C:\project\workspace\collecter\node_modules\node-expat

> node-gyp rebuild

 

C:\nodejs\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )

Warning: Missing input files:

C:\nodejs\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\libexpat\version.c

이 솔루션의 프로젝트를 한 번에 하나씩 빌드합니다. 병렬 빌드를 사용하려면 "/m" 스위치를 추가하세요.

  xmlparse.c

  xmltok.c

  xmlrole.c

c:\nodejs\node_modules\node-expat\deps\libexpat\lib\xmlparse.c(6): warning C4068: 알 수 없는 pragma입니다. [C:\nodejs\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]

  win_delay_load_hook.cc

  expat.vcxproj -> C:\nodejs\node_modules\node-expat\build\Release\\libexpat.lib

  node-expat.cc

  win_delay_load_hook.cc

c:\users\admin\appdata\local\node-gyp\cache\12.16.1\include\node\node.h(669): warning C4819: 현재 코드 페이지(949)에서 표시할 수 없는 문자가 파일에 들어 있습니다. 데이터가 손실되지 않게 하려면 해당 파일을 유니코드 형

식으로 저장하십시오. (소스 파일 컴파일 중 ..\node-expat.cc) [C:\pro

ject\nodejs\node_modules\node-expat\build\node_expat.vcxproj]

C:\\Users\\admin\\AppData\\Local\\node-gyp\\Cache\\12.16.1\\x64\\node.lib : fatal error LNK1106: 파일이 잘못되었거나 디스크가 꽉 찼습니다. 0x2FC71E() 찾을 수 없습니다. [C:\nodejs\node_modules\node-expat\build\node_expa

t.vcxproj]

gyp ERR! build error 

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

gyp ERR! stack     at ChildProcess.onExit (C:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)

gyp ERR! stack     at ChildProcess.emit (events.js:311:20)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

gyp ERR! System Windows_NT 10.0.18362

gyp ERR! command "C:\\nodejs\\node.exe" "C:\\nodejs\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

 

npm 업데이트를 해봄

PS C:\nodejs> npm -v

6.13.4

PS C:\nodejs> npm cache clean -f

npm WARN using --force I sure hope you know what you are doing.

C:\Users\admin\AppData\Roaming\npm\npx -> C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js

C:\Users\admin\AppData\Roaming\npm\npm -> C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js

+ npm@6.14.4

added 435 packages from 869 contributors in 221.964s

PS C:\nodejs> npm -v

6.14.4

 

npm 버전을 올려봤지만 될리가..

PS C:\nodejs> npm install

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/reqnpm WARN using --force I sure hope you know what you are doing.uest/request/issues/3142

npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

npm WARN deprecated joi@13.7.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

npm WARN deprecated hoek@5.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs 

and security issues.

npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs 

and security issues.

 

> node-expat@2.3.18 install C:\nodejs\node_modules\node-expat

> node-gyp rebuild

 

 

C:\nodejs\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )        

Warning: Missing input files:

C:\nodejs\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\libexpat\version.c

이 솔루션의 프로젝트를 한 번에 하나씩 빌드합니다. 병렬 빌드를 사용하려면 "/m" 스위치를 추가

하세요.

  xmlparse.c

  xmltok.c

  xmlrole.c

c:\nodejs\node_modules\node-expat\deps\libexpat\lib\xmlparse.c(6): wa

rning C4068: 알 수 없는 pragma입니다. [C:\nodejs\node_modules\node-expat\bui

ld\deps\libexpat\expat.vcxproj]

  win_delay_load_hook.cc

  expat.vcxproj -> C:\nodejs\node_modules\node-expat\build\Release\\l

  ibexpat.lib

  node-expat.cc

  win_delay_load_hook.cc

c:\users\admin\appdata\local\node-gyp\cache\12.16.1\include\node\node.h(669): warning C4819

: 현재 코드 페이지(949)에서 표시할 수 없는 문자가 파일에 들어 있습니다. 데이터가 손실되지 않게 하려면 해당 파일을 유니코드 형식으로 저장하십시오. (소스

 파일 컴파일 중 ..\node-expat.cc) [C:\nodejs\node_modules\node-expat\build\

node_expat.vcxproj]

C:\\Users\\admin\\AppData\\Local\\node-gyp\\Cache\\12.16.1\\x64\\node.lib : fatal error LNK

1106: 파일이 잘못되었거나 디스크가 꽉 찼습니다. 0x2FC71E() 찾을 수 없습니다. [C:\nodejs\node

_modules\node-expat\build\node_expat.vcxproj]

gyp ERR! build error 

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

gyp ERR! stack     at ChildProcess.onExit (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)

gyp ERR! stack     at ChildProcess.emit (events.js:311:20)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

gyp ERR! System Windows_NT 10.0.18362

gyp ERR! command "C:\\nodejs\\node.exe" "C:\\Users\\admin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

gyp ERR! cwd C:\nodejs\node_modules\node-expat

gyp ERR! node -v v12.16.1

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

npm WARN collecter@0.0.1 No description

npm WARN collecter@0.0.1 No repository field.

npm WARN collecter@0.0.1 No license field.

 

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! node-expat@2.3.18 install: `node-gyp rebuild`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the node-expat@2.3.18 install 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\admin\AppData\Roaming\npm-cache\_logs\2020-04-14T05_20_30_691Z-debug.log

 


 해결문제 X파일 인가… 했는데

node-gyp 문서를 보니 windows 그냥은 안되고

2가지 옵션중에 하나정도는 설정해줘야 하는듯...

1. npm install --global --production windows-build-tools

2. npm config set msvs_version 2017

참고: https://github.com/nodejs/node-gyp#on-windows

 

PS C:\nodejs> npm install --global --production windows-build-tools

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

 

> windows-build-tools@5.2.2 postinstall C:\Users\admin\AppData\Roaming\npm\node_modules\windows-build-tools

> node ./dist/index.js

 

 

Downloading vs_BuildTools.exe

[============================================>] 100.0% of 1.12 MB (106.65 kB/s)

Downloaded vs_BuildTools.exe. Saved to C:\Users\admin\.windows-build-tools\vs_BuildTools.exe.

 

Starting installation...

Please restart this script from an administrative PowerShell!

The build tools cannot be installed without administrative rights.

To fix, right-click on PowerShell and run "as Administrator".

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! windows-build-tools@5.2.2 postinstall: `node ./dist/index.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the windows-build-tools@5.2.2 postinstall 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\admin\AppData\Roaming\npm-cache\_logs\2020-04-16T02_00_50_995Z-debug.log

첫번째는 보기좋게 실패 visual studio code에서 powershell로 했는데 안되네…

 

메시지를 잘보면 restart administrator 라는문구가 보인다

관리자 권한으로 다시 시도해주자

PS C:\nodejs>  npm install --global --production windows-build-tools

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

 

> windows-build-tools@5.2.2 postinstall C:\Users\admin\AppData\Roaming\npm\node_modules\windows-build-tools

> node ./dist/index.js

 

 

 

Downloading vs_BuildTools.exe

[>                                            ] 0.0% (0 B/s)

Downloaded vs_BuildTools.exe. Saved to C:\Users\admin\.windows-build-tools\vs_BuildTools.exe.

 

Starting installation...

Launched installers, now waiting for them to finish.

This will likely take some time - please be patient!

 

Status from the installers:

---------- Visual Studio Build Tools ----------

 [name: VS/ABExp/FlightRequest] [properties: {"VS.ABExp.Flight":"vswshowbitrate","VS.ABExp.Result":"False"}]

2020-04-16T11:16:22 : Verbose : Resolved RemoteSettingsProviderService.GetBooleanValue(collectionPath, key, defaultValue) collectionPath: Installer\Features\, key: ShowBitrate, defaultValue: false, 

result: false

2020-04-16T11:16:22 : Verbose : Resolved RemoteSettingsProviderService.GetBooleanValue(collectionPath, key, defaultValue) collectionPath: Installer\Features\, key: RecommendSel, defaultValue: false, result: true

2020-04-16T11:16:22 : Verbose : Resolved RemoteSettingsProviderService.GetBooleanValue(collectionPath, key, defaultValue) collectionPath: Installer\Features\, key: Surveys, defaultValue: false, result: true

2020-04-16T11:16:32 : Verbose : Resolved RemoteSettingsProviderService.GetActionsAsync(actionPath) 

actionPath: vs\installer\commonerroractions, result: []

------------------- Python --------------------

Python 2.7.17 is already installed, not installing again.

이상태에서 멈춤… ㅂㄷㅂㄷ

http://blog.naver.com/PostView.nhn?blogId=captpro&logNo=221866509281

이분걸 보니 @4.0.0 으로 하셨길래 따라해 볼까하다가 때려침

반응형

'programing > Nodejs' 카테고리의 다른 글

nodejs 설치(windows)  (0) 2022.08.08
fast-xml 숫자 코드 파싱 (0000 -> 0) 해결  (0) 2021.01.23

관련글 더보기

댓글 영역