title: getting `sh: 1: exec: nest: not found` error deploying nestjs to google app engine
body: <p>I am trying to deploy my nestjs application to google app engine, but I get <code>sh: 1: exec: nest: not found</code> error</p>
  <p>my package.json</p>
  <pre><code>    &quot;main&quot;: &quot;dist/main.js&quot;,
      &quot;scripts&quot;: {
          &quot;prebuild&quot;: &quot;rimraf dist&quot;,
          &quot;build&quot;: &quot;nest build&quot;,
          &quot;format&quot;: &quot;prettier --write \&quot;src/**/*.ts\&quot; \&quot;test/**/*.ts\&quot;&quot;,
          &quot;start&quot;: &quot;nest start&quot;,
          &quot;start:dev&quot;: &quot;nest start --watch&quot;,
          &quot;start:debug&quot;: &quot;nest start --debug --watch&quot;,
          &quot;start:prod&quot;: &quot;node dist/main&quot;,
          &quot;lint&quot;: &quot;eslint \&quot;{src,apps,libs,test}/**/*.ts\&quot; --fix&quot;,
          &quot;test&quot;: &quot;jest&quot;,
          &quot;test:watch&quot;: &quot;jest --watch&quot;,
          &quot;test:cov&quot;: &quot;jest --coverage&quot;,
          &quot;test:debug&quot;: &quot;node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand&quot;,
          &quot;test:e2e&quot;: &quot;jest --config ./test/jest-e2e.json&quot;,
          &quot;gcp-build&quot;: &quot;npm run build&quot;,
          &quot;ae:deploy&quot;: &quot;gcloud app deploy --quiet&quot;,
          &quot;ae:browse&quot;: &quot;gcloud app browse&quot;,
          &quot;@nestjs/cli&quot;: &quot;^8.0.0&quot;,
      }
         
  </code></pre>
  <p>DockerFile</p>
  <pre><code>FROM node:14-alpine
  
  WORKDIR /usr/src/app
  ENV NODE_ENV=production
  
  COPY package*.json ./
  
  RUN npm install -g @nestjs/cli@8
  
  RUN npm install
  
  COPY . ./
  
  RUN npm run build
  
  CMD [ &quot;npm&quot;, &quot;run&quot;, &quot;start:prod&quot; ]
  </code></pre>
  <p>app.yaml</p>
  <pre><code>runtime: nodejs14
  service: default
  
  instance_class: F1
  
  env_variables:
    NODE_ENV: 'production'
  
  </code></pre>
  <p>CloudBuild.yaml</p>
  <pre><code>steps:
  - name: &quot;gcr.io/cloud-builders/docker&quot;
    args:
    - build
    - &quot;--tag=gcr.io/cmor-baas-dev/kafka-connector:latest&quot;
    - &quot;--file=Dockerfile&quot;
    - .  
  images:
  - &quot;gcr.io/cmor-baas-dev/kafka-connector&quot;
  timeout: 1800s
  </code></pre>
  <p><a href="https://i.stack.imgur.com/RQax8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RQax8.png" alt="npm run ae:deploy" /></a></p>
  <p><a href="https://i.stack.imgur.com/TiZ2c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TiZ2c.png" alt="logs" /></a></p>
  <p>I think both Dockerfile and CloudBuild.yaml files are ignored (I am new to Google app engine, not sure do we need those files)</p>
  <h2>Update</h2>
  <p>Based on <a href="https://cloud.google.com/appengine/docs/standard/nodejs/specifying-dependencies" rel="nofollow noreferrer">here</a>,</p>
  <blockquote>
  <p>All dependencies that you define under the devDependencies field are
  ignored and do not get installed for your app in App Engine.</p>
  </blockquote>
  <p>So I moved <code>@nestjs/cli</code> to <code>dependencies</code> in my package.json, still same error</p>