Getting started with NPM...
I can run the following command to start my app.
node app
But when I run the following command, I get the following error:
npm start
Windows Script Host Object expected
Line 2
800A138F
Microsoft JScript runtime error
App.js:
var port = 5000;
var express = require('express');
Package.json:
{
"name": "2",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.13.3"
}
}
And I've run this command of course:
npm install express --save
Seems like NPM can't find the express package? Why not?
I know its too late to answer, but in case any wanderer like me faces the same problem in future..
need to add node
keyword ahead of app.js
in script. So, start script should
"scripts": {
"start": "node app.js"
},
That solved for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With