ENOENT: no such file or directory, open 'package.json': clasp ts file not transpiling to js file

84 views Asked by At

I have a clasp project so that contains one ts file . The code is plain vanilla js inside the .ts file. If I do the command "clasp push", I get the following error

C:\Google Drive\App Script Projects\new test 4>clasp push

ENOENT: no such file or directory, open 'package.json'

If I change the file extension to js, the command "clasp push" works and uploads the js file. So I'm guessing that the code that transpiles the ts to the js is messed up. I have re-installed the clasp code from github, but I still have the same problem.

1

There are 1 answers

0
TheMaster On

This is a known issue #875: https://github.com/google/clasp/issues/875

As mentioned by joshsny here, Simply create a empty package.json at the root of your typescript directory.

{}