Git Product home page Git Product logo

Comments (15)

kamkudla avatar kamkudla commented on May 18, 2024 3

@Swizec This was it! Solved with brew reinstall watchman

from typescript.

Swizec avatar Swizec commented on May 18, 2024 2

For anyone coming here in the future, it's a watchman issue.

This helps: jestjs/jest#4529

from typescript.

masters3d avatar masters3d commented on May 18, 2024

What global version of TS and node?

Have you tried yarn?

from typescript.

CRivasGomez avatar CRivasGomez commented on May 18, 2024

Hi @matthewharwood !

Even when you tag your test cases with xit they will be examined by the TypeScript transpiler to find errors.

After fixing those tests, as @masters3d says, I would recommend you to run yarn test inside hello-world folder after running yarn install (instead of npm test)

If it doesn't work for you, let us know πŸ‘

from typescript.

matthewharwood avatar matthewharwood commented on May 18, 2024

Still failing on my properly hello-world.ts. I uninstalled node_modules and deleted .locks files then yarn installed then yarn test and it hangs still.

tsc -v
Version 2.7.2

node -v
v9.4.0

yarn -v
1.5.1

You mentioned to list my node version so...
I also tried to downgrade to node LTS v8.10.0. On a new hello-world project I ran

  • npm install -g typescript && yarn
  • cd into hello-world
  • yarn
  • yarn test
$ tsc --noEmit -p . && jest --no-cache
hello-world.test.ts(11,12): error TS2554: Expected 0 arguments, but got 1.
hello-world.test.ts(15,12): error TS2554: Expected 0 arguments, but got 1.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c tsc --noEmit -p . && jest --no-cache
Directory: /Users/matty/exercism/typescript/hello-world
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/matty/exercism/typescript/hello-world/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here's an abridged log:

Arguments: 
  /Users/matty/.nvm/versions/node/v8.10.0/bin/node /Users/matty/.nvm/versions/node/v8.10.0/bin/yarn test

PATH: 
  /Users/matty/.nvm/versions/node/v8.10.0/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Yarn version: 
  1.5.1

Node version: 
  8.10.0

Platform: 
  darwin x64
  
Trace: 
  Error: Command failed.
  Exit code: 1
  Command: sh
  Arguments: -c tsc --noEmit -p . && jest --no-cache
  Directory: /Users/matty/exercism/typescript/hello-world
  Output:
  
      at ProcessTermError.MessageError (/Users/matty/.nvm/versions/node/v8.10.0/lib/node_modules/yarn/lib/cli.js:186:110)
      at new ProcessTermError (/Users/matty/.nvm/versions/node/v8.10.0/lib/node_modules/yarn/lib/cli.js:226:113)
      at ChildProcess.<anonymous> (/Users/matty/.nvm/versions/node/v8.10.0/lib/node_modules/yarn/lib/cli.js:30281:17)
      at emitTwo (events.js:126:13)
      at ChildProcess.emit (events.js:214:7)
      at maybeClose (internal/child_process.js:925:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

Then I fix the code for the tests

class HelloWorld {
    static hello( name = 'World' ) {
        return `Hello ${name}!`
    }
}

export default HelloWorld

I leave the tests cases the same and/or remove the x from xit:


import HelloWorld from "./hello-world"

describe('Hello World', () => {

  it('says hello world with no name', () => {
    expect(HelloWorld.hello()).toEqual('Hello, World!')
  })

  xit('says hello to bob', () => {
    expect(HelloWorld.hello('Bob')).toEqual('Hello, Bob!')
  })

  xit('says hello to sally', () => {
    expect(HelloWorld.hello('Sally')).toEqual('Hello, Sally!')
  })
})

and no feedback after

$ yarn test
yarn run v1.5.1
$ tsc --noEmit -p . && jest --no-cache

just seems to pause there.

from typescript.

masters3d avatar masters3d commented on May 18, 2024

what does yarn install say?

from typescript.

masters3d avatar masters3d commented on May 18, 2024

can you try reinstalling typescript?
#124

from typescript.

matthewharwood avatar matthewharwood commented on May 18, 2024

Per @vermiculus comment in #124 I ran:

rm -rf ~/exercism/typescript # your exercism directory
npm uninstall -g typescript && npm uninstall -g yarn # if originally installed via npm
rm -rf ~/node_modules/ # remove node modules
brew install typescript yarn
exercism fetch typescript
cd ~/exercism/typescript/hello_world/ # or wherever exercism places the directory

From there I cd ~/exercism/typescript/hello-world.
The following should be the yarn install output you asked for:

matty@laptop: ~/exercism/typescript/hello-world
$ yarn install && yarn test
yarn install v1.5.1
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ“ƒ  Building fresh packages...
✨  Done in 3.41s.
yarn run v1.5.1

$ tsc --noEmit -p . && jest --no-cache
hello-world.test.ts(11,12): error TS2554: Expected 0 arguments, but got 1.
hello-world.test.ts(15,12): error TS2554: Expected 0 arguments, but got 1.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c tsc --noEmit -p . && jest --no-cache
Directory: /Users/matty/exercism/typescript/hello-world
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/matty/exercism/typescript/hello-world/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
matty@laptop: ~/exercism/typescript/hello-world

I fixed the code for the tests again:

class HelloWorld {
    static hello( name = 'World' ) {
        return `Hello ${name}!`
    }
}

export default HelloWorld

Ran same command:

$ yarn install && yarn test
yarn install v1.5.1
[1/4] πŸ”  Resolving packages...
success Already up-to-date.
✨  Done in 0.32s.
yarn run v1.5.1
$ tsc --noEmit -p . && jest --no-cache

Still justs hangs here after the yarn test.

Small update that tsc --noEmit -p . runs and completes. jest --no-cache is what seemingly breaks

from typescript.

masters3d avatar masters3d commented on May 18, 2024

okay. This may be a mac issue with the new version of ts.

@CRivasGomez Do you happen to have a mac to test this? I am on a windows machine this weekend.

from typescript.

CRivasGomez avatar CRivasGomez commented on May 18, 2024

@masters3d I'm a using a mac machine.
I have just tested hello-world exercise and it works perfectly.

➜ tsc -v
Version 2.7.2
➜ yarn -v
1.5.1
➜ node -v
v9.8.0
➜ npm -v
5.6.0

from typescript.

matthewharwood avatar matthewharwood commented on May 18, 2024

@CRivasGomez if you complete the task

class HelloWorld {
    static hello( name = 'World' ) {
        return `Hello ${name}!`
    }
}

export default HelloWorld

Do the tests still run or does it get hung up?

from typescript.

masters3d avatar masters3d commented on May 18, 2024

I haven’t been able to reproduce. Sorry. We added Mac builds and they are passing.

from typescript.

CRivasGomez avatar CRivasGomez commented on May 18, 2024

@matthewharwood they run perfectly on my mac.

from typescript.

masters3d avatar masters3d commented on May 18, 2024

reopen if you feel this has not been addressed.

from typescript.

nandin-borjigin avatar nandin-borjigin commented on May 18, 2024

Installation of fsevent of version locked in downloaded yarn.lock file is failed, and installation of subsequent packages are also failed thus causing the hang-on.

Environments:

  • macOS: 10.13.5 (17F77)
  • node: v10.0.0
  • yarn: 1.6.0
  • network: Behind China GFW

Deleting the yarn.lock file before running yarn install would prevent the problem, but also causes the dependency resolution to run on every new exercise and it really takes a lot of time.

from typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.