npm start Microsoft JScript runtime error 800A138F object expected

前端 未结 5 694
名媛妹妹
名媛妹妹 2020-12-16 23:32

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

相关标签:
5条回答
  • 2020-12-17 00:16

    I know its too late to answer, but in case any wanderer like me faces the same problem in future..

    Solution:

    need to add node keyword ahead of app.js in script. So, start script should

    "scripts": { "start": "node app.js" },

    That solved for me.

    0 讨论(0)
  • 2020-12-17 00:18

    If you're using Visual Studio Code, it may have taken over running the script. If in VS Code, hit F5 and see if the project runs properly. I don't know why it does this, but did for me. This tipped me off

    0 讨论(0)
  • 2020-12-17 00:23

    Use >node app.js instead of >app.js

    Then it will work

    0 讨论(0)
  • 2020-12-17 00:23

    I had this problem as well. The .js files are associated with the Microsoft Script Engine. Some suggested that we dis-associate the extension with the program, but I do not think that is necessary. I was able to fix the issue with the following instruction that I found in the NODE Docs.

    Please make sure that your file(s) referenced in bin starts with

    #!/usr/bin/env node
    

    otherwise the scripts are started without the node executable!

    0 讨论(0)
  • 2020-12-17 00:29

    When I faced the same problem using Visual Studio Code, I was trying to run localhost at port 8080, however by pressing F5 I was able to know that the port was already taken and so I changed the port to 3000, and viola! that worked for me.

    Check out the error

    0 讨论(0)
提交回复
热议问题