question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows - Can't build node modules with spaces on the path

See original GitHub issue

I trying to compile https://www.npmjs.com/package/net-ping on my nw.js application, but my user folder on Windows have a space, this cause this error:

C:\nwjs\My New App\node_modules\net-ping>nw-gyp rebuild --target=0.28.2 gyp info it worked if it ends with ok gyp info using nw-gyp@3.6.3 gyp info using node@8.9.0 | win32 | x64 gyp http GET http://node-webkit.s3.amazonaws.com/v0.28.2/nw-headers-v0.28.2.tar.gz gyp http 200 http://node-webkit.s3.amazonaws.com/v0.28.2/nw-headers-v0.28.2.tar.gz gyp http GET http://node-webkit.s3.amazonaws.com/v0.28.2/x64/nw.lib gyp http GET http://node-webkit.s3.amazonaws.com/v0.28.2/nw.lib gyp http GET http://node-webkit.s3.amazonaws.com/v0.28.2/x64/node.lib gyp http GET http://node-webkit.s3.amazonaws.com/v0.28.2/node.lib gyp http 200 http://node-webkit.s3.amazonaws.com/v0.28.2/x64/node.lib gyp http 200 http://node-webkit.s3.amazonaws.com/v0.28.2/x64/nw.lib gyp http 200 http://node-webkit.s3.amazonaws.com/v0.28.2/node.lib gyp http 200 http://node-webkit.s3.amazonaws.com/v0.28.2/nw.lib gyp info spawn C:\Python27\python.exe gyp info spawn args [ ‘C:\Users\Mitsuha Kitsune\AppData\Roaming\npm\node_modules\nw-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:\nwjs\My New App\node_modules\net-ping\build\config.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘C:\Users\Mitsuha Kitsune\AppData\Roaming\npm\node_modules\nw-gyp\addon.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘C:\Users\Mitsuha Kitsune\.nw-gyp\0.28.2\common.gypi’, gyp info spawn args ‘-Dlibrary=shared_library’, gyp info spawn args ‘-Dvisibility=default’, gyp info spawn args ‘-Dnode_root_dir=C:\Users\Mitsuha Kitsune\.nw-gyp\0.28.2’, gyp info spawn args ‘-Dnode_gyp_dir=C:\Users\Mitsuha Kitsune\AppData\Roaming\npm\node_modules\nw-gyp’, gyp info spawn args ‘-Dnode_lib_file=“C:\Users\Mitsuha Kitsune\.nw-gyp\0.28.2\<(target_arch)\node.lib”’, gyp info spawn args ‘-Dnw_lib_file=“C:\Users\Mitsuha Kitsune\.nw-gyp\0.28.2\<(target_arch)\nw.lib”’, gyp info spawn args ‘-Dmodule_root_dir=C:\nwjs\My New App\node_modules\net-ping’, gyp info spawn args ‘-Dnode_engine=v8’, gyp info spawn args ‘–depth=.’, gyp info spawn args ‘–no-parallel’, gyp info spawn args ‘-Dv13=1’, gyp info spawn args ‘–generator-output’, gyp info spawn args ‘C:\nwjs\My New App\node_modules\net-ping\build’, gyp info spawn argsC:\Python27\python.exe: can’t open file ‘C:\Users\Mitsuha’: [Errno 2] No such file or directory ‘-Goutput_dir=.’ ] gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 2 gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Mitsuha Kitsune\AppData\Roaming\npm\node_modules\nw-gyp\lib\configure.js:359: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_process.js:198:12) gyp ERR! System Windows_NT 10.0.16299 gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\Mitsuha Kitsune\AppData\Roaming\npm\node_modules\nw-gyp\bin\nw-gyp.js” “rebuild” “–target=0.28.2” gyp ERR! cwd C:\nwjs\My New App\node_modules\net-ping gyp ERR! node -v v8.9.0 gyp ERR! nw-gyp -v v3.6.3 gyp ERR! not ok

Appear only error of nw-gyp, the oficial node-gyp don’t have this issue but when I try to load the module compiled with node-gyp the console shows a Uncaught Error: Error in a dynamic link library initialization routine (DLL)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
shellkacommented, May 10, 2018

3.6.2 version works fine

0reactions
tonetechniciancommented, Mar 6, 2019

Thanks @shellka

Rolling back to nw-gyp v3.6.2 worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Nodejs cannot find installed module on Windows
Create NODE_PATH and set it %AppData%\npm\node_modules in order to require('<pkg_name>') in scripts without install it in the project directory.
Read more >
Path | Node.js v19.3.0 Documentation
The node:path module provides utilities for working with file and directory paths ... On Windows Node.js follows the concept of per-drive working directory....
Read more >
It's possible to have a path with spaces in .npmrc on Windows?
[Solved]-It's possible to have a path with spaces in .npmrc on Windows?-node.js ... Unfortunately npm will split on all Spaces, no matter how...
Read more >
Naming Files, Paths, and Namespaces - Win32 apps
All file systems supported by Windows use the concept of files and directories to access data stored on a disk or device.
Read more >
node-sass - npm
Node -sass is a library that provides binding for Node.js to ... Path to a file for LibSass to compile. ... Type: String;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found