I was trying to upgrade node version on our CI environment from node 6 to node 8. I updated the full-icu version as well.
the $NODE_ICU_DATA
is set to /usr/lib/node_modules/full-icu
but still get this error
node: could not initialize ICU (check NODE_ICU_DATA or --icu-data-dir parameters)
Any idea, how to fix this?
You need to run npm install
including the full-icu
package. It's full-icu
's postinstall step which downloads the appropriate bits for the currently executing node. Note that multiple files may show up in the full-icu
directory, that's OK.
If you already had full-icu
installed, but upgraded Node.js in between:
npm rebuild
fixes the issue.
If you already had full-icu
installed, but did upgrade node in between:
npm rebuild
does fix the issue.
If you want use Node.js with full-icu and Docker, you can use example of Dockerfile:
FROM node:lts-alpine
WORKDIR /icu
RUN npm init -y && npm install full-icu
ENV NODE_ICU_DATA=/icu/node_modules/full-icu
WORKDIR /project
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD [ "node", "server.js" ]
It's works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With