Reputation: 463
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?
Upvotes: 46
Views: 30167
Reputation: 4350
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.
Upvotes: 72
Reputation: 163
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.
Upvotes: 8
Reputation: 1895
If you already had full-icu
installed, but did upgrade node in between:
npm rebuild
does fix the issue.
Upvotes: 30