Authentication Error with EDU License Token (E401)
Hi Mobiscroll Team đź‘‹
I'm currently running a project using Mobiscroll React components, and everything worked perfectly during the 90-day trial. I was using a token of the form:
8PRsomethingX37yGCsKVNanonymousszFdrE1HBYSOMETHINGrQeBtIJ
This token was injected through my .env
file into Docker (via ARG NPM_TOKEN
), and npm install worked flawlessly within my Docker container.
Now, I've received a new token via the 12 months EDU License program (thanks! 🙏). The new token looks like this:
something-aaaa-bbbb-111a-a5ezaevvz43
(Note: this is a fake token format for the example).
However, after replacing the old token with the new one and rebuilding the container using:
docker compose up --build
I now consistently get the following error during npm install --legacy-peer-deps
:
=> ERROR [client 5/8] RUN npm install --legacy-peer-deps
------
> [client 5/8] RUN npm install --legacy-peer-deps:
npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/...
failed to solve: process "/bin/sh -c npm install --legacy-peer-deps" did not complete successfully: exit code: 1
exit status 17
Environment Info:
- Docker Compose for both frontend and backend
- The token is passed via
.env
→ARG NPM_TOKEN
- Inside the Dockerfile, I copy
.npmrc
with//npm.mobiscroll.com/:_authToken=${NPM_TOKEN}
Package.json :
{
"name": "client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --host",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@mobiscroll/react": "npm:@mobiscroll/react-next-trial@^5.34.2",
"@radix-ui/react-alert-dialog": "^1.1.6",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-label": "^2.1.3",
"@radix-ui/react-popover": "^1.1.6",
"@radix-ui/react-select": "^2.1.6",
"@radix-ui/react-separator": "^1.1.2",
"@radix-ui/react-slot": "^1.2.0",
"@tailwindcss/vite": "^4.0.17",
"class-variance-authority": "^0.7.1",
"client": "file:",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"date-fns": "^4.1.0",
"lucide-react": "^0.484.0",
"next-themes": "^0.4.6",
"react": "^19.0.0",
"react-day-picker": "^8.10.1",
"react-dom": "^19.0.0",
"react-router-dom": "^7.4.0",
"rsuite": "^5.79.1",
"sonner": "^2.0.2",
"tailwind-merge": "^3.0.2",
"tailwindcss": "^4.0.17",
"tw-animate-css": "^1.2.4"
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@types/node": "^22.13.14",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.21.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"typescript": "~5.7.2",
"typescript-eslint": "^8.24.1",
"vite": "^6.2.0"
}
}
Dockerfile (client):
FROM node:latest
WORKDIR /app
ARG NPM_TOKEN
COPY .npmrc .npmrc
COPY package*.json ./
RUN npm install --legacy-peer-deps
RUN rm -f .npmrc
COPY . .
RUN npm rebuild
EXPOSE 3000
CMD ["npm", "run", "dev"]
Any help would be greatly appreciated. Thank you! I'm happy to provide my email in a private message if needed.
Best regards,
Pierrick