Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! code 1 - when npm install #2682

Closed
macveriz opened this issue Jun 16, 2022 · 5 comments
Closed

npm ERR! code 1 - when npm install #2682

macveriz opened this issue Jun 16, 2022 · 5 comments

Comments

@macveriz
Copy link

I got this when i want to install node app from npm install, i dont know what i have been missed

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /home/ubuntu/.nvm/versions/node/v16.15.1/bin/node /home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/ubuntu/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /home/ubuntu/.npm/_cacache/tmp/git-clonegRuxAe
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node-gyp rebuild
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using node-gyp@9.0.0
npm ERR! npm ERR! gyp info using node@16.15.1 | linux | x64
npm ERR! npm ERR! gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
npm ERR! npm ERR! gyp info spawn /usr/bin/python3
npm ERR! npm ERR! gyp info spawn args [
npm ERR! npm ERR! gyp info spawn args '/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! npm ERR! gyp info spawn args '-f',
npm ERR! npm ERR! gyp info spawn args 'make',
npm ERR! npm ERR! gyp info spawn args '-I',
npm ERR! npm ERR! gyp info spawn args '/home/ubuntu/.npm/_cacache/tmp/git-clonegRuxAe/build/config.gypi',
npm ERR! npm ERR! gyp info spawn args '-I',
npm ERR! npm ERR! gyp info spawn args '/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! npm ERR! gyp info spawn args '-I',
npm ERR! npm ERR! gyp info spawn args '/home/ubuntu/.cache/node-gyp/16.15.1/include/node/common.gypi',
npm ERR! npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! npm ERR! gyp info spawn args '-Dnode_root_dir=/home/ubuntu/.cache/node-gyp/16.15.1',
npm ERR! npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! npm ERR! gyp info spawn args '-Dnode_lib_file=/home/ubuntu/.cache/node-gyp/16.15.1/<(target_arch)/node.lib',
npm ERR! npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/ubuntu/.npm/_cacache/tmp/git-clonegRuxAe',
npm ERR! npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! npm ERR! gyp info spawn args '--depth=.',
npm ERR! npm ERR! gyp info spawn args '--no-parallel',
npm ERR! npm ERR! gyp info spawn args '--generator-output',
npm ERR! npm ERR! gyp info spawn args 'build',
npm ERR! npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! gyp ERR! build error
npm ERR! npm ERR! gyp ERR! stack Error: not found: make
npm ERR! npm ERR! gyp ERR! stack at getNotFoundError (/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/which/which.js:10:17)
npm ERR! npm ERR! gyp ERR! stack at /home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/which/which.js:57:18
npm ERR! npm ERR! gyp ERR! stack at new Promise ()
npm ERR! npm ERR! gyp ERR! stack at step (/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/which/which.js:54:21)
npm ERR! npm ERR! gyp ERR! stack at /home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/which/which.js:71:22
npm ERR! npm ERR! gyp ERR! stack at new Promise ()
npm ERR! npm ERR! gyp ERR! stack at subStep (/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/which/which.js:69:33)
npm ERR! npm ERR! gyp ERR! stack at /home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/which/which.js:80:22
npm ERR! npm ERR! gyp ERR! stack at /home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/isexe/index.js:42:5
npm ERR! npm ERR! gyp ERR! stack at /home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
npm ERR! npm ERR! gyp ERR! System Linux 5.15.0-1011-aws
npm ERR! npm ERR! gyp ERR! command "/home/ubuntu/.nvm/versions/node/v16.15.1/bin/node" "/home/ubuntu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! npm ERR! gyp ERR! cwd /home/ubuntu/.npm/_cacache/tmp/git-clonegRuxAe
npm ERR! npm ERR! gyp ERR! node -v v16.15.1
npm ERR! npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! npm ERR! gyp ERR! not ok
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /home/ubuntu/.npm/_logs/2022-06-16T03_49_19_396Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2022-06-16T03_49_11_280Z-debug-0.log

@cclauss
Copy link
Contributor

cclauss commented Jun 16, 2022

npm ERR! npm ERR! gyp ERR! stack Error: not found: make

sudo apt-get update
sudo apt-get install build-essential

@cclauss
Copy link
Contributor

cclauss commented Jun 30, 2022

@macveriz Can this issue be closed or are you still blocked?

@Sahastracookcoder1
Copy link

Kindly provide the solution in windows as well this command is Linux based. @cclauss

@cclauss cclauss added the Linux label Jul 8, 2022
@cclauss
Copy link
Contributor

cclauss commented Jul 8, 2022

@Sahastracookcoder1 Please open a separate issue for Windows with:

  1. The command as it was typed.
  2. The full error log.

@Sahastracookcoder1
Copy link

I have resolved the error, It was similar to this, and it has been determined by updating node-gyp.

How I resolved the error:

First: I located my node installed in my system by the where command in windows.
Second: then navigate to the C:\Program Files\nodejs\node_modules\npm by using cd command.
Third: thereafter updated the node-gyp by this command npm install -g node-gyp@latest

and the node-gyp error gets resolved.

@cclauss cclauss closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants