The npm (Node Package Manager) application is a package manager for the JavaScript language that allows you to install JavaScript libraries or modules by using the npm install command.
npm is bundled together with NodeJS, so each time you install a specific version of NodeJS on your local computer, you will also have a specific version of npm bundled with it.
You can check the currently installed npm version using the npm --version command:
But sometimes, you may encounter the npm is not recognized error as shown below:
> npm --version 'npm' is not recognized as an internal or external command, operable program or batch file.
The error above happens when the Windows operating system doesn’t know what to do with the npm command.
To fix the error, you need to make sure that the Node executable file is available under your PATH setting.
Note: NodeJS should have added the executable location to your PATH variable during installation process, but sometimes it may fail to do so.
You can add new entry to the Windows PATH environment variable using the Command Prompt as follows:
> SET PATH=C:\Program Files\Nodejs;%PATH% > npm
Or you can set the PATH variable by using Windows graphical UI.
The following steps will help you to fix the error from Windows interface.
Fixing npm is not recognized error on Windows OS
First, Go to My Computer or This PC for Windows 10. Right-click on empty space and open the Properties window:
Click Advanced system settings from the left bar of the Properties window:
Now you’re in the System Properties window. Click the Environment Variables... button:
Now you’re in the Environment Variables window. Select the Path variable from either the User Variables or System Variables table and click on the Edit... button:
At the end of the variable values, add C:\Program Files\nodejs as a new entry to your Path variable:
If you installed NodeJS on another location, then you need to change the entry to your custom location. Remember to always enter the absolute path from the drive letter to your NodeJS program folder.
Once done, click OK and open a new Terminal or Command Line window. If you’re calling npm from the VSCode terminal, you need to restart VSCode first before trying again.
The npm is not recognized error should be fixed and you should be able to check this using the npm --version command:
If you still get the error, then try restarting your computer first. The error should be gone after you restart.
Now you should be able to install any npm package to your local computer with npm install command. Great job on fixing the error!
Related articles:
- The npm install -s flag explained
- Using npm install with -g flag explained
- Using npm init with -y flag explained
- Creating development dependencies with npm install -D command
- Why and how to clear npm cache
Hii team
This is my work
npm start > start C:\Users\07\OneDrive\Desktop\Final Try\fabcar-blockchain-sample\web-app\server > ./node_modules/nodemon/bin/nodemon.js src/app.jsI'm getting this error
'.' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! start: `./node_modules/nodemon/bin/nodemon.js src/app.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\07\AppData\Roaming\npm-cache\_logs\2020-05-04T13_24_08_021Z-debug.log '.' is not recognized as an internal or external command,.Here, in this I'm following the basic edureka tutorial. But I'm geting error as "'.' is not recognized as an internal or external command".How to solve this error?
• 37,500 points • 6,791 views
1 answer to this question.
Hello @kartik,
Edit package.json and remove the ./.
Change
to
"start": "nodemon src/app.js"Alternatively, you can try:
npm install -g nodemonand change the start command to
"start": "./node_modules/nodemon/bin/nodemon.js src/app.js"Thank You!!
• 82,740 points
Related Questions In Blockchain
- All categories
- Apache Kafka (84)
- Apache Spark (596)
- Azure (131)
- Big Data Hadoop (1,907)
- Blockchain (1,673)
-
C# (122)
- C++ (228)
-
Career Counselling (1,060)
- Cloud Computing (3,356)
- Cyber Security & Ethical Hacking (145)
- Data Analytics (1,266)
- Database (525)
- Data Science (73)
- DevOps & Agile (3,500)
-
Digital Marketing (111)
- Events & Trending Topics (28)
- IoT (Internet of Things) (387)
- Java (1,122)
- Kotlin (3)
- Linux Administration (384)
- Machine Learning (337)
- MicroStrategy (6)
- PMP (423)
- Power BI (516)
- Python (3,137)
- RPA (650)
- SalesForce (92)
- Selenium (1,569)
- Software Testing (56)
- Tableau (608)
- Talend (73)
- TypeSript (123)
- Web Development (2,747)
- Ask us Anything! (66)
- Others (899)
Subscribe to our Newsletter, and get personalized recommendations.
Already have an account? Sign in.