Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Request path contains unescaped characters #1021

Closed
Tobbe opened this issue Sep 6, 2016 · 6 comments
Closed

TypeError: Request path contains unescaped characters #1021

Tobbe opened this issue Sep 6, 2016 · 6 comments

Comments

@Tobbe
Copy link

Tobbe commented Sep 6, 2016

This is the output I get when I try to install a package that needs node-gyp (node-sass in this case):

$ node ./path/to/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\user_name\\xxx\\node_modules_59\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.4.0
gyp info using node@5.9.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\user_name\xxx\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\Users\user_name\xxx\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\Users\user_name\xxx\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\Users\user_name\xxx\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\Users\user_name\xxx\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\user_name\xxx\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb `which` failed  python2 { [Error: not found: python2] code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python27\python.EXE
gyp verb check python version `C:\Python27\python.EXE -c "import platform; print(platform.python_version());"` returned: "2.7.12\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 5.9.0
gyp verb command install [ '5.9.0' ]
gyp verb install input version string "5.9.0"
gyp verb install installing version: 5.9.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 0
gyp verb needs "installVersion" 9
gyp verb install version is no good; reinstalling
gyp verb ensuring nodedir is created C:\Users\user_name\.node-gyp\5.9.0
gyp http GET https://nodejs.org/download/release/v5.9.0/node-v5.9.0-headers.tar.gz
gyp verb download using proxy url: "http://proxy.company.com:8080"
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: Request path contains unescaped characters.
gyp ERR! stack     at new ClientRequest (_http_client.js:53:11)
gyp ERR! stack     at TunnelingAgent.exports.request (http.js:31:10)
gyp ERR! stack     at TunnelingAgent.createSocket (C:\Users\user_name\xxx\node_modules\tunnel-agent\index.js:117:25)
gyp ERR! stack     at TunnelingAgent.createSecureSocket [as createSocket] (C:\Users\user_name\xxx\node_modules\tunnel-agent\index.js:184:41)
gyp ERR! stack     at TunnelingAgent.addRequest (C:\Users\user_name\xxx\node_modules\tunnel-agent\index.js:80:8)
gyp ERR! stack     at new ClientRequest (_http_client.js:147:16)
gyp ERR! stack     at Object.exports.request (http.js:31:10)
gyp ERR! stack     at Object.exports.request (https.js:197:15)
gyp ERR! stack     at Request.start (C:\Users\user_name\xxx\node_modules\request\index.js:582:30)
gyp ERR! stack     at Request.end (C:\Users\user_name\xxx\node_modules\request\index.js:1149:28)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user_name\\xxx\\node_modules_59\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\user_name\xxx
gyp ERR! node -v v5.9.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>

The error message at the core of it all seems to be "TypeError: Request path contains unescaped characters". Which is very confusing, because google seems to suggest it's something wrong with my proxy settings. But I don't know what it could be.

Some relevant information about my system setup:

$ npm config list | grep 'proxy\|ssl\|registry'
https-proxy = "http://proxy.company.com:8080/"
proxy = "http://proxy.company.com:8080/"
registry = "http://nexus.company.com/nexus/path/to/npm-modules/"
strict-ssl = false
$ git config --list | grep 'proxy\|sslverify'
http.proxy=http://proxy.company.com:8080
http.sslverify=false
$ env | grep -i 'node_tls\|proxy'
NODE_TLS_REJECT_UNAUTHORIZED=0
HTTP_PROXY=http://proxy.company.com:8080

What is wrong/missing in my setup?

@Tobbe
Copy link
Author

Tobbe commented Sep 6, 2016

You can sort of figure most of it out from the error message above, but just to be clear: This is on Windows 7 with node v5.9. I've also tried 5.12, 6.4 and 6.5

@Tobbe
Copy link
Author

Tobbe commented Sep 6, 2016

I can manually download the header files and specify the path to them with --tarball, but then I get stuck on issue #1002 And even if that would have worked it wouldn't have been a good solution in the long run :)

@bnoordhuis
Copy link
Member

That 'Request path contains unescaped characters' means there is a space in the request path (because that's all node.js core checks for.)

I don't know exactly what goes wrong but apparently something somewhere is letting a blank slip through.

@Tobbe
Copy link
Author

Tobbe commented Sep 6, 2016

Any idea how to debug this further?

@bnoordhuis
Copy link
Member

Not really. Maybe add a few console.log statements to tunnel-agent/index.js? env NODE_DEBUG="http tunnel" node-gyp <cmd> (adjust for windows shell syntax) might help too.

@Tobbe
Copy link
Author

Tobbe commented Sep 12, 2016

If I manually run npm install node-sass before npm install everything works. I will investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants