How to solve 'vue-cli-service' is not recognized as an internal or external command?

前端 未结 8 1298
北海茫月
北海茫月 2021-01-03 18:07

I am getting an error when trying to run npm run serve. At first I installed node.js then vue as well as vue/cli. But when I am trying to run server as -> npm r

8条回答
  •  失恋的感觉
    2021-01-03 18:44

    npm install @vue/cli-service -g
    

    This will install global npm package.

    @vue/cli-service is usully installed as global, because you do not usually copy these types of packages to every project.

    If the global npm package gets corrupted, it is not stored in node_modules folder, but rather in other depending on the os. Therefore removing node_modules does not help. Locations for global node_modules folders are %USERPROFILE%\AppData\Roaming\npm\node_modules (Win10) or /usr/local/lib/node_modules (Linux) Check this stack overflow post on how to locate global packages.

提交回复
热议问题