问题
When I use this command in command mode:
D:\xampp\htdocs\profileApp>npm run dev
I get this error:
'npm' is not recognized as an internal or external command, operable program or batch file.
How can I solve this?
回答1:
First of all, I assume you are a Windows user. In this case, you need to download and install NPM together with NodeJS from the official website. When installing, do not unselect the "Add to PATH variables" point. It's important that NPM is added to your PATH variables, so it's globally available.
After installing, simply restart your terminal(s)
回答2:
Download and install Gitbash it will be used to run such commands. `
Git bash will help you emulate bash commands. Read this article with how to use git and npm on windows with Git Bash
回答3:
First you need to install Node which comes with NPM bundled in so that it would be recognizable by Windows CMD you can download the latest version from the Official Website.
Optional : If you are willing to work on open source projects consider installing Git for windows
来源:https://stackoverflow.com/questions/44249800/how-can-i-install-npm-in-laravel-5-4