Error Failed to parse json-This is not a bug in npm

0 votes

When I'm trying to install express with npm I always get the following error:

Failed to parse json
No data, empty input at 1:1
File: /root/.npm/inherits/2.0.1/package/package.json
Failed to parse package.json data.
package.json must be actual JSON, not just JavaScript.

This is not a bug in npm.
Tell the package author to fix their package.json file. JSON.parse

What am I doing wrong?

 sudo npm install -g express
Nov 27, 2020 in Node-js by kartik
• 37,510 points
3,945 views

1 answer to this question.

0 votes

Hello @kartik,

Try this:

npm cache clean

Hope it works!!

Thank you!!

answered Nov 27, 2020 by Niroj
• 82,880 points

Related Questions In Node-js

0 votes
0 answers
0 votes
1 answer

How to clean node_modules folder of packages that are not in package.json?

Hello @kartik, You could remove your node_modules/ folder ...READ MORE

answered Jul 13, 2020 in Node-js by Niroj
• 82,880 points
29,416 views
0 votes
1 answer

Error:nvm is not compatible with the npm config "prefix" option:

Hello @kartik, After installing nvm using brew, create ~/.nvm directory: $ ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,880 points
4,165 views
0 votes
1 answer

How to update a value in a json file and save it through node.js?

Hello @kartik, It's particularly useful if you're concerned ...READ MORE

answered Oct 12, 2020 in Node-js by Niroj
• 82,880 points
25,271 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
21,750 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
2,647 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
2,504 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
41,363 views
0 votes
2 answers

Error:'TypeError: is not a function' in Node.js

You are exporting module.exports.redir = redir; That means that ...READ MORE

answered Oct 21, 2020 in Node-js by anonymous
• 140 points
16,472 views
0 votes
1 answer

How to write a test which expects an Error to be thrown in Jasmine?

Hello @kartik, Try using an anonymous function instead: expect( ...READ MORE

answered Jul 13, 2020 in Node-js by Niroj
• 82,880 points
8,590 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP