typescript: sh: nuxt-ts: not found when building in a Docker container
Dockerfile:
FROM node:12-alpine
ENV APP_ROOT /site
RUN mkdir ${APP_ROOT}
WORKDIR ${APP_ROOT}
ADD . ${APP_ROOT}
RUN npm i
RUN npm run build
ENV HOST 0.0.0.0
When i build an image, i get an erorr: sh: nuxt-ts: not found
My package.json:
{
"name": "serke-client",
"version": "1.0.0",
"description": "Serke client",
"author": "Alexander Kim",
"private": true,
"scripts": {
"dev": "nuxt-ts",
"build": "nuxt-ts build",
"start": "nuxt-ts start",
"generate": "nuxt-ts generate",
"lint": "eslint --ext .ts,.js,.vue ."
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.25",
"@fortawesome/free-brands-svg-icons": "^5.11.2",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/vue-fontawesome": "^0.1.7",
"@nuxt/typescript-runtime": "^0.2.2",
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/style-resources": "^1.0.0",
"@nuxtjs/svg": "^0.1.6",
"bootstrap": "^4.1.3",
"bootstrap-vue": "^2.0.0",
"nuxt": "^2.0.0",
"nuxt-fontawesome": "^0.4.0",
"vue-property-decorator": "^8.3.0"
},
"devDependencies": {
"@nuxt/typescript-build": "^0.3.2",
"@nuxtjs/eslint-config": "^1.0.1",
"@nuxtjs/eslint-config-typescript": "^0.1.3",
"@nuxtjs/eslint-module": "^1.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^6.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"node-sass": "^4.12.0",
"prettier": "^1.16.4",
"sass-loader": "^8.0.0"
}
}
Locally i can build it, but within a docker container - not, what do i miss @kevinmarrec ?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (13 by maintainers)
Overall I think you can’t npm run command through
RUNcause of some environment the command is run dunno You can maybe tryEDIT : ultimately :
in your volume section in docker-compose.yml add node_modules volume
example : volumes: - ./src/client:/app/client - /app/client/node_modules
Well yeah in fact it should be kind of
@webcoderkz No but well it seems
npmjust doesn’t fit for now : https://github.com/nuxt/typescript/issues/145Maybe
CMD [ "npm", "run", "build" ]in Dockerfile ?