Functions-samples: Typescript functions tslint error when build

Created on 14 Dec 2017  路  2Comments  路  Source: firebase/functions-samples

How to reproduce these conditions

{
  "name": "functions",
  "scripts": {
    "build": "./node_modules/.bin/tslint -p tslint.json && ./node_modules/.bin/tsc",
    "serve": "npm run build && firebase serve --only functions",
    "shell": "npm run build && firebase experimental:functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "main": "lib/index.js",
  "dependencies": {
    "@types/express": "^4.0.37",
    "firebase-admin": "^5.5.1",
    "firebase-functions": "^0.7.3",
    "typescript": "^2.6.2"
  },
  "devDependencies": {
    "tslint": "^5.8.0",
    "typescript": "^2.5.3"
  },
  "private": true
}

Steps to set up and reproduce

node v6.11.5
npm v3.10.10

Debug output

npm ERR! Darwin 17.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! functions@ serve: `npm run build && firebase serve --only functions`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ serve script 'npm run build && firebase serve --only functions'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the functions package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build && firebase serve --only functions
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs functions
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls functions
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:


Expected behavior

Build functions with use of the TSLint

Actual behavior

See error, without ./node_modules/.bin/tslint -p tslint.json && it's builds fine

PS: npm bugs functions then you get functions but not firebase-functions?!

All 2 comments

What happens if (from your functions directory) you run ./node_modules/.bin/tslint -p tslint.json ? It sounds like you have a linter error, which should have been printed earlier in the debug output.

Yep, it was a linter error... hanging on a import that was never used

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rovel picture Rovel  路  5Comments

beratuslu picture beratuslu  路  4Comments

Qzingo picture Qzingo  路  3Comments

6vedant picture 6vedant  路  5Comments

inglesuniversal picture inglesuniversal  路  5Comments