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.
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",
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",