Node-gyp: Cannot install module due to encoding issues(?)

Created on 1 Aug 2018  ยท  2Comments  ยท  Source: nodejs/node-gyp

  • Node Version: node v.8.11.3, npm v.6.2.0
  • Platform: Windows 8.1 Professional
  • Compiler: VS Community 2017 with all nessesary packages.
  • Module: tried to build ref-napi, whatever that is. It's a dependency.
    Verbose output (from npm or node-gyp):
C:\Users\ะ“ะตะพั€ะณะธะน\node_modules\ref-napi\ref-napi>node-gyp --python C:\Users\ะ“ะตะพั€ะณ
ะธะน\.windows-build-tools\python27\python.exe configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn C:\Users\ะ“ะตะพั€ะณะธะน\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'C:\\Users\\ะ“ะตะพั€ะณะธะน\\AppData\\Roaming\\npm\\node_modules\\
node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ะ“ะตะพั€ะณะธะน\\node_modules\\ref-napi\\ref-napi\\bui
ld\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ะ“ะตะพั€ะณะธะน\\AppData\\Roaming\\npm\\node_modules\\
node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ะ“ะตะพั€ะณะธะน\\.node-gyp\\8.11.3\\include\\node\\com
mon.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\ะ“ะตะพั€ะณะธะน\\.node-gyp\\8.11.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\ะ“ะตะพั€ะณะธะน\\AppData\\Roaming\\npm\
\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\ะ“ะตะพั€ะณะธะน\\.node-gyp\\8.11.3\\<(
target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\ะ“ะตะพั€ะณะธะน\\node_modules\\ref-n
api\\ref-napi',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\ะ“ะตะพั€ะณะธะน\\node_modules\\ref-napi\\ref-napi\\bui
ld',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: C:\Users\โ•จะฃโ•จโ•กโ•จโ•›โ•คะโ•จโ”‚โ•จโ••โ•จโ•ฃ\node_modules\node-addon-api\src\node_api.gyp not fo
und (cwd: C:\Users\โ”œั…ัŽะัƒัˆั‰\node_modules\ref-napi\ref-napi) while loading depende
ncies of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\ะ“ะตะพั€ะณะธะน\AppData\Roaming\np
m\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:198:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ะ“ะตะพั€ะณะธะน\\AppD
ata\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "--python" "C:\\Use
rs\\ะ“ะตะพั€ะณะธะน\\.windows-build-tools\\python27\\python.exe" "configure"
gyp ERR! cwd C:\Users\ะ“ะตะพั€ะณะธะน\node_modules\ref-napi\ref-napi
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok


Looks like there's an encoding problem with cyrillic folder names? Sadly I cannot at the moment rename user folder due to most of my apps will stop functioning after that.

Problem seems to occur only with GYP since most of my previous experiments with nodeJS and what not were going smoothly, and this one requires me always passing python location to it, even though I've set PYTHON env. var.

Any ideas how to instal ref-napi? Using npm install doesnt work too, that's why I manually cloned git repo and tried configure.

Most helpful comment

This is an issue with Python 2: https://bugs.python.org/issue2128, https://stackoverflow.com/questions/846850. I don't know if we can/should work around this in the gyp side.

@TorlanDelta I have two suggestions for working around this, they seemed to work for my test case but I don't know if they'll work well or create other issues. 1) Try to compile or npm install out of that folder, and then move it there. 2) use dir /X to see the short name for that folder, then cd into the folder using the sort name and use npm that way.

All 2 comments

This is an issue with Python 2: https://bugs.python.org/issue2128, https://stackoverflow.com/questions/846850. I don't know if we can/should work around this in the gyp side.

@TorlanDelta I have two suggestions for working around this, they seemed to work for my test case but I don't know if they'll work well or create other issues. 1) Try to compile or npm install out of that folder, and then move it there. 2) use dir /X to see the short name for that folder, then cd into the folder using the sort name and use npm that way.

@joaocgreis Thank you a lot, using short name worked like a charm (through standard windows powershell only though, powershell tool for Atom didn't work like that, weird)

Proceeded to compile everything with no problem whatsoever.

Sorry that I blamed this wonderful package for this, I will keep in mind that this is python speaking :D

Cheers!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kimown picture kimown  ยท  3Comments

gengjiawen picture gengjiawen  ยท  3Comments

jlchereau picture jlchereau  ยท  3Comments

swaj picture swaj  ยท  3Comments

Sentero-esp12 picture Sentero-esp12  ยท  3Comments