Cannot convert name to ASCII
See original GitHub issueI’m hit by an issue where node-gyp fails when rebuilding java bindings. Tried various different versions of node-gyp
, but the issue remains. Strangely it only fails inside the official node-docker
images. Locally on my Macbook
Node: 7.10.0 (official docker image)
error /opt/app/node_modules/java: Command failed.
Exit code: 7
Command: sh
Arguments: -c node-gyp rebuild
Directory: /opt/app/node_modules/java
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.1
gyp info using node@7.10.0 | linux | x64
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: Cannot convert name to ASCII
gyp ERR! stack at Url.parse (url.js:317:23)
gyp ERR! stack at urlParse (url.js:75:5)
gyp ERR! stack at Object.urlResolve [as resolve] (url.js:642:10)
gyp ERR! stack at processRelease (/usr/local/lib/node_modules/node-gyp/lib/process-release.js:86:19)
gyp ERR! stack at configure (/usr/local/lib/node_modules/node-gyp/lib/configure.js:37:17)
gyp ERR! stack at Object.self.commands.(anonymous function) [as configure] (/usr/local/lib/node_modules/node-gyp/lib/node-gyp.js:55:37)
gyp ERR! stack at run (/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js:87:30)
gyp ERR! stack at _combinedTickCallback (internal/process/next_tick.js:73:7)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:104:9)
gyp ERR! System Linux 4.9.21-moby
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /opt/app/node_modules/java
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.6.1
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>
Minimal package.json:
{
"name": "npm-gyp-bug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"java": "0.8.0"
}
}
Dockerfile:
FROM node:7.10.0
RUN apt-get update
# Java Version
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 45
ENV JAVA_VERSION_BUILD 14
ENV JAVA_PACKAGE jdk
# Download and unarchive Java
RUN curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie"\
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
| tar -xzf - -C /opt &&\
ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} /opt/jdk &&\
rm -rf /opt/jdk/*src.zip \
/opt/jdk/lib/missioncontrol \
/opt/jdk/lib/visualvm \
/opt/jdk/lib/*javafx* \
/opt/jdk/jre/lib/plugin.jar \
/opt/jdk/jre/lib/ext/jfxrt.jar \
/opt/jdk/jre/bin/javaws \
/opt/jdk/jre/lib/javaws.jar \
/opt/jdk/jre/lib/desktop \
/opt/jdk/jre/plugin \
/opt/jdk/jre/lib/deploy* \
/opt/jdk/jre/lib/*javafx* \
/opt/jdk/jre/lib/*jfx* \
/opt/jdk/jre/lib/amd64/libdecora_sse.so \
/opt/jdk/jre/lib/amd64/libprism_*.so \
/opt/jdk/jre/lib/amd64/libfxplugins.so \
/opt/jdk/jre/lib/amd64/libglass.so \
/opt/jdk/jre/lib/amd64/libgstreamer-lite.so \
/opt/jdk/jre/lib/amd64/libjavafx*.so \
/opt/jdk/jre/lib/amd64/libjfx*.so
# Prepare java
RUN npm i -g node-gyp
# Set environment
ENV JAVA_HOME /opt/jdk
ENV PATH ${PATH}:${JAVA_HOME}/bin
RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY . /opt/app
# Yarn fails with the full-icu package
RUN npm i full-icu
ENV NODE_ICU_DATA node_modules/full-icu
RUN yarn && yarn build
EXPOSE 8080
CMD ["node", "/opt/app/index.js"]
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Hub 2.2.1 "Cannot convert name to ASCII" break all functionality
this seems to be due to an error in initialization. from the logs, i got this error: {"moduleName":"Auth","level":"warn","message":"[ Error: ...
Read more >javascript - Convert accented text into ASCII characters?
I would like to convert accented letters and various encodings into the plain English ASCII one in Javascript and wonder what are the...
Read more >Text to ASCII Code Converter - Chars to ASCII Numbers - Online
Useful, free online tool that converts plain text to ASCII codes. No ads, nonsense, or garbage, just an ASCII converter. Press a button...
Read more >iconv cannot convert from ASCII.. why? - Unix Stack Exchange
It's not ASCII so you can't convert the file from ASCII to anything else. After some investigation, encoding CP437 appears to give a...
Read more >Convert Text to Numeric Values - MATLAB & Simulink
If str2double cannot convert text to a number, then it returns a NaN value. ... cause unintended side effects when the text input...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve opened a bug for the obscure error message nodejs/node#13043
After some more digging, this seems to be indeed related to
icu
. Withouticu
the build runs perfectly fine.