Vercel: All of a sudden "tsc: not found"

Created on 1 Aug 2018  路  1Comment  路  Source: vercel/vercel

tsc
sh: tsc: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! errno ENOENT


npm run build works locally
but when running now the "npm run build" fails after deploy on zeit's side

Trying to redeploy the previous successful version (checkout older from git), now gives the same error as well.


Found #1007 (https://github.com/zeit/now-cli/issues/1007) which seemed similar.
However my issue didn't go away when deleting the package.lock file.

Thanks for your time.

Most helpful comment

This was caused by having a now.json
"env": { "NODE_ENV": "production" }

When Now runs in "production" it does not install devDependencies, which Typescript is.

The fix was to remove NODE_ENV from now.json, and pass as part of the npm script, like so:
"start": "NODE_ENV=production npm run serve",

>All comments

This was caused by having a now.json
"env": { "NODE_ENV": "production" }

When Now runs in "production" it does not install devDependencies, which Typescript is.

The fix was to remove NODE_ENV from now.json, and pass as part of the npm script, like so:
"start": "NODE_ENV=production npm run serve",

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbillamboz picture davidbillamboz  路  3Comments

pex picture pex  路  3Comments

plug-n-play picture plug-n-play  路  3Comments

bkniffler picture bkniffler  路  3Comments

Rowno picture Rowno  路  3Comments