Npm install not working in X-Press Publishing project

Hello i am currently on X-Press Publishing project https://www.codecademy.com/paths/web-development/tracks/building-a-persistent-api/modules/persistent-api-cumulative-projects/projects/x-press-publishing and one of the first tasks is to run npm install in terminal.When i do that i get this error. I just opened starting code and ran command in VS Code terminal , i have also tried it in Git Bash and it does not work. These are screenshots:


1 Like

Thanks in advance :slightly_smiling_face:

Did you read it?
Error messages are for reading. No really, that’s the whole purpose.

It says useful things. Like, that there’s no pre-built …something that was needed, of that version, available, that python isn’t installed so this thing couldn’t be built either.

If those are the problems that occurred, then that also says something about what you can do. You could use a different version, perhaps up-to-date versions have prebuilt binaries available. Or install python, then you can build it (of course more things might be required, but if you wanted to build it then you’d install the thing that was missing and try again, repeat until it’s all there)

You can try:

npm install --save-dev @babel/preset-env

npm install --save-dev @babel/core

npm install mocha@7.1.0 --save

Edit package.json

sqlite3 to 4.1.1

body-parser to 1.19.0

Add “babel-core": “^6.26.3”

// Not sure if the above edit is necessary (or correct), but it makes the dependency error go away

npm clean install

In the end… my package.json was as follows below:

{
“name”: “x-press-publishing”,
“version”: “1.0.0”,
“description”: “”,
“main”: “server.js”,
“scripts”: {
“test”: “mocha”
},
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“body-parser”: “^1.19.0”,
“chai”: “^4.1.2”,
“cors”: “^2.8.5”,
“errorhandler”: “^1.5.1”,
“express”: “^4.17.1”,
“mocha”: “^7.1.0”,
“morgan”: “^1.9.1”,
“random-flat-colors”: “^1.0.4”,
“react”: “^15.6.1”,
“react-dom”: “^15.6.1”,
“react-router-dom”: “^4.2.2”,
“sqlite3”: “^4.1.1”,
“supertest”: “^3.0.0”,
“whatwg-fetch”: “^2.0.3”
},
“devDependencies”: {
@babel/core”: “^7.8.4”,
@babel/preset-env”: “^7.8.4”,
“babel”: “^6.23.0”,
“babel-core”: “^6.26.3”,
“babel-loader”: “^7.1.2”,
“babel-preset-react”: “^6.24.1”,
“babel-preset-stage-2”: “^6.24.1”,
“webpack”: “^3.5.5”
}
}

I have the same issue. After going through all the troubleshooting with Xcode and installing the command-line tools, I still don’t resolve the issue. Here are some of the screenshots in my integrated command-line:

Thank you

1 Like

I’m also experiencing the same problem and I can’t fix it :frowning:

Not only I read it, but also my husband who is a developer.

here the solution :wink:

1 Like

Had same problem, took 17 hrs before I found this. Thanks.

changing sqlite3 version in package.json solved it for me!

1 Like

“Be kind to your fellow community members.” From the sidebar guidelines.

“Did you read it?
Error messages are for reading. No really, that’s the whole purpose.” A moderator.

This is a surprisingly condescending answer to a legit question.

3 Likes

Particularly when there is absolutely no education on how to interpret and resolve such issues, work with JSON files or packages as part of the learning path, apart from just installing them.

Thank you so much. It was just that. I did all kinds of things ans kept running into more problems.