Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialhenriquegiuliani
12,296 PointsHow do i run a node project with my project name? (global module)
Is there any way to run my node project on CLI without node app.js
?
Ex: if my project calls "weatherapp", can i use weatherapp
on CLI to run it?
2 Answers
Brody Chen
11,252 PointsIn your package.json file, you can add
"scripts": {
"weatherapp": "node app.js"
}
And then you can run node weatherapp
henriquegiuliani
12,296 PointsRufeng Chen i made it.... check it out!
Brody Chen
11,252 PointsWow, you made your own npm package. Super cool!
henriquegiuliani
12,296 Pointshenriquegiuliani
12,296 PointsI tried... but CLI doesn't recongnize the command "weatherapp"
Brody Chen
11,252 PointsBrody Chen
11,252 PointsCan you provide the output in your CLI?