denolib / typeorm

Forked from https://github.com/typeorm/typeorm
MIT License
120 stars 16 forks source link

Property 'utime' does not exist on type 'typeof Deno' #49

Closed hugoblanc closed 4 years ago

hugoblanc commented 4 years ago

Issue type:

[ ] question [x] bug report [ ] feature request [ ] documentation issue

Steps to reproduce or a small repository showing the problem:

Every attempt to use the package trigger Property 'utime' does not exist on type 'typeof Deno'.

My last try (even if i'm not sure to use it correctly):

import {createConnection} from 'https://denolib.com/denolib/typeorm@v0.2.23-rc3/mod.ts';

createConnection({
    type: "mysql",
    host: "localhost",
    port: 3306,
    username: "root",
    password: "admin",
    database: "test",
    entities: [
        "entities/*.ts"
    ],
    synchronize: true,
}).then(connection => {
    // here you can start to work with your entities
}).catch(error => console.log(error));
Compile file:///home/hugo/Documents/programming/perso/poc/deno/connexion.ts
error TS2339: Property 'utime' does not exist on type 'typeof Deno'.
    await Deno.utime(dest, statInfo.atime, statInfo.mtime);
               ~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:90:16

error TS2339: Property 'utimeSync' does not exist on type 'typeof Deno'.
    Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:101:10

error TS2339: Property 'symlink' does not exist on type 'typeof Deno'.
  await Deno.symlink(originSrcFilePath, dest, type);
             ~~~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:114:14

error TS2339: Property 'utime' does not exist on type 'typeof Deno'.
    await Deno.utime(dest, statInfo.atime, statInfo.mtime);
               ~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:119:16

error TS2339: Property 'symlinkSync' does not exist on type 'typeof Deno'.
  Deno.symlinkSync(originSrcFilePath, dest, type);
       ~~~~~~~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:132:8

error TS2339: Property 'utimeSync' does not exist on type 'typeof Deno'.
    Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:137:10

error TS2339: Property 'utime' does not exist on type 'typeof Deno'.
    await Deno.utime(dest, srcStatInfo.atime, srcStatInfo.mtime);
               ~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:157:16

error TS2339: Property 'utimeSync' does not exist on type 'typeof Deno'.
    Deno.utimeSync(dest, srcStatInfo.atime, srcStatInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@v0.42.0/fs/copy.ts:185:10

error TS2339: Property 'link' does not exist on type 'typeof Deno'.
  await Deno.link(src, dest);
             ~~~~
    at https://deno.land/std@v0.42.0/fs/ensure_link.ts:28:14

error TS2339: Property 'linkSync' does not exist on type 'typeof Deno'.
  Deno.linkSync(src, dest);
       ~~~~~~~~
    at https://deno.land/std@v0.42.0/fs/ensure_link.ts:52:8

error TS2339: Property 'symlink' does not exist on type 'typeof Deno'.
  await Deno.symlink(src, dest, srcFilePathType);
             ~~~~~~~
    at https://deno.land/std@v0.42.0/fs/ensure_symlink.ts:31:14

error TS2339: Property 'symlinkSync' does not exist on type 'typeof Deno'.
  Deno.symlinkSync(src, dest, srcFilePathType);
       ~~~~~~~~~~~
    at https://deno.land/std@v0.42.0/fs/ensure_symlink.ts:58:8
uki00a commented 4 years ago

Hi @hugoblanc, thanks for opening this issue!

Some Deno APIs (such as Deno.utime, Deno.link, etc.) have been treated as unstable since v1.0.0-rc1.

You need to specify the --unstable flag in order to use them as follows:

$ deno run --unstable --allow-net --allow-read --allow-env ./connexion.ts
hugoblanc commented 4 years ago

Thanks a lot !