`npm install` fails on setting up starter project from official nextjs course
Answered
Japanese common catfish posted this in #help-forum
Japanese common catfishOP
So yea, I'm following the nextjs official course from [here](https://nextjs.org/learn). When I try to set up the starter code using this command (
Any help is highly appreciated.
npx create-next-app@latest nextjs-dashboard --use-npm --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example") provided in the tutorial, I get this error in my terminal;Downloading files from repo https://github.com/vercel/next-learn/tree/main/dashboard/starter-example. This might take a moment.
Installing packages. This might take a couple of minutes.
npm ERR! code 7
npm ERR! path /mnt/bulk_disk/development/personal_projects/learning-nextjs/nextjs-dashboard/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! A complete log of this run can be found in: /home/victor/.npm/_logs/2024-04-04T04_33_28_467Z-debug-0.log
Aborting installation.
npm install has failed.Any help is highly appreciated.
Answered by Ray
sudo apt-get install -y build-essential pythonmake sure you have these packages installed on your system
https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#ubuntu-and-derivatives---elementary-linux-mint-etc
4 Replies
@Ray what OS are you using?
Japanese common catfishOP
ubuntu 22.04
@Japanese common catfish So yea, I'm following the nextjs official course from [here](https://nextjs.org/learn). When I try to set up the starter code using this command (`npx create-next-app@latest nextjs-dashboard --use-npm --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example"`) provided in the tutorial, I get this error in my terminal;
Downloading files from repo https://github.com/vercel/next-learn/tree/main/dashboard/starter-example. This might take a moment.
Installing packages. This might take a couple of minutes.
npm ERR! code 7
npm ERR! path /mnt/bulk_disk/development/personal_projects/learning-nextjs/nextjs-dashboard/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! A complete log of this run can be found in: /home/victor/.npm/_logs/2024-04-04T04_33_28_467Z-debug-0.log
Aborting installation.
npm install has failed.
Any help is highly appreciated.
sudo apt-get install -y build-essential pythonmake sure you have these packages installed on your system
https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#ubuntu-and-derivatives---elementary-linux-mint-etc
Answer
because
bcrypt need these package on your system to build