1. 程式人生 > 其它 >‘vue-cli-service‘ 不是內部或外部命令,也不是可執行的程式 或批處理檔案

‘vue-cli-service‘ 不是內部或外部命令,也不是可執行的程式 或批處理檔案

You need to install theVue CLI Servicebefore you can run the binary. Try installing at the project-level as opposed to globally instead.

在執行二進位制檔案之前,您需要安裝 Vue CLI 服務。嘗試在專案級安裝,而不是全域性安裝。

The 404 is a "feature" ofnpxwhereby it attempts to download (then execute) missing packages unless the--no-install

flag is passed. The reason it cannot findvue-cli-serviceis because that particular package doesn't exist in the registry.

404是 npx 的一個“特性”,它試圖下載(然後執行)丟失的包,除非傳遞 -- no-install 標誌。之所以找不到 vue-cli-service,是因為這個特定的包在登錄檔中不存在。

Note the package name for Vue CLI Service is@vue/cli-servicewhich differs from the name of the binary it installs. Let's hope no one is ever able to register a module calledvue-cli-service

for security reasons. Because if they do you'd've downloaded and run their module instead.

請注意,Vue CLI Service 的包名為@Vue/CLI-Service,這與它所安裝的二進位制檔案的名稱不同。出於安全原因,希望沒有人能夠註冊一個名為 vue-cli-service 的模組。因為如果他們這麼做了,你就會下載並執行他們的模組。

複製以下指令執行即可

npm i @vue/cli-service