question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm start gave Cannot find name 'expect'. errors

See original GitHub issue

Fixed by adding

    "types": [
      "jasmine"
    ]

to tsconfig.json

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "target": "es5",
    "types": [
      "jasmine"
    ]
  },
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

hth Tim

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
tja4472commented, Oct 31, 2016

This works:

  "exclude": [
    "node_modules",
    "e2e",
    "**/*.spec.ts"    
  ],
1reaction
tja4472commented, Dec 26, 2016

Hi @frabnt

Reverting to typescript 2.0.10 worked for me.

  "devDependencies": {
    "@ionic/app-scripts": "0.0.48",
    "@types/jasmine": "2.5.38",
    "@types/node": "6.0.42",
    "angular-cli": "1.0.0-beta.24",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.7.0",
    "karma": "1.3.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-cli": "1.0.1",
    "karma-jasmine": "1.1.0",
    "karma-mocha-reporter": "2.2.1",
    "karma-remap-istanbul": "0.2.2",
    "protractor": "4.0.13",
    "protractor-jasmine2-screenshot-reporter": "0.3.2",
    "ts-node": "1.7.2",
    "tslint": "4.1.1",
    "tslint-eslint-rules": "3.2.0",
    "typescript": "2.0.10"
  },

ionic info

 ordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.48
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.2
Xcode version: Not installed

npm 4.0.5

hth Tim

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find name 'describe'. Do you need to install type ...
I'm using Visual Studio Code as my IDE and in my Angular project, and I had to comment-out/remove types in file tsconfig.json and...
Read more >
Cannot find name 'describe' Error in TypeScript | bobbyhadz
To solve the "Cannot find name 'describe'" error, install the type definitions for your test runner, e.g. npm i -D @types/jest or npm...
Read more >
How to Fix the “Cannot Find name 'describe'” Error in TypeScript
To fix the “cannot find name 'describe'” error, install the type definitions for your testing framework, and then add the definitions to the ......
Read more >
TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >
Forge bundling errors on Typescript jest tests
Try `npm i @types/jest` or `npm i @types/mocha`.[tsl] ERROR in /app/src/dependencyGraph.test.ts(46,5) TS2304: Cannot find name 'expect'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found