node.js websocket module installed but won't work in scripts

后端 未结 3 976
慢半拍i
慢半拍i 2021-02-14 22:36

I just installed node.js + microsoft visual to be able to install the websocket, it installed fine:

C:\\Users\\Administrator>npm install websocket
npm http G         


        
3条回答
  •  没有蜡笔的小新
    2021-02-14 23:07

    I´ve got same error here.. I follow these steps:

    Execute cmd as Administrator (Right click cmd icon-> Run as Administrator) Then type in cmd:

    c:\Node Instalation Dir\> npm install -g express
    c:\Node Instalation Dir\> npm install websocket --force
    

    Now u can run your script:

    c:\Node Instalation Dir\> node script.js
    

    I did in a test server.. try to dont use '--force' in production server ok?

提交回复
热议问题