0

How can I write a script for npm that installs the node_modules in an angular 2 project and compiles the ts files. This doesn't work:

"scripts": {
"firstBuild": "npm install && tsc", 
....

I get the error:

> npm firstBuild

Usage: npm <command>

where <command> is one of:

PS:

I can run "start" : "tsc && concurrently \"tsc -w\" \"lite-server\" just like npm start , why can't I do npm firstBuild ?

1 Answer 1

1

I think you just forgot to use run.

Try npm run firstBuild.

Sign up to request clarification or add additional context in comments.

1 Comment

But I can run "start" : "tsc && concurrently \"tsc -w\" \"lite-server\" just like npm start, why can't I do npm firstBuild ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.