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 · 7 comments
Closed

npm ERR! code 1 - when npm install #2682

macveriz opened this issue Jun 16, 2022 · 7 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
@ugur010
Copy link

ugur010 commented Nov 8, 2024

l/ for more details.
npm warn deprecated eslint@6.8.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm error code 1
npm error path C:\xampp\htdocs\node_modules\node-sass
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm error Building: C:\Program Files\nodejs\node.exe C:\xampp\htdocs\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm error gyp info it worked if it ends with ok
npm error gyp verb cli [
npm error gyp verb cli 'C:\Program Files\nodejs\node.exe',
npm error gyp verb cli 'C:\xampp\htdocs\node_modules\node-gyp\bin\node-gyp.js',
npm error gyp verb cli 'rebuild',
npm error gyp verb cli '--verbose',
npm error gyp verb cli '--libsass_ext=',
npm error gyp verb cli '--libsass_cflags=',
npm error gyp verb cli '--libsass_ldflags=',
npm error gyp verb cli '--libsass_library='
npm error gyp verb cli ]
npm error gyp info using node-gyp@3.8.0
npm error gyp info using node@22.11.0 | win32 | x64
npm error gyp verb command rebuild []
npm error gyp verb command clean []
npm error gyp verb clean removing "build" directory
npm error gyp verb command configure []
npm error gyp verb check python checking for Python executable "C:\Python27\python.exe" in the PATH
npm error gyp verb which succeeded C:\Python27\python.exe C:\Python27\python.exe
npm error (node:9144) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.
npm error (Use node --trace-deprecation ... to show where the warning was created)
npm error gyp verb check python version C:\Python27\python.exe -c "import sys; print "2.7.18 npm error gyp verb check python version .%s.%s" % sys.version_info[:3];" returned: %j
npm error gyp verb get node dir no --target version specified, falling back to host node version: 22.11.0
npm error gyp verb command install [ '22.11.0' ]
npm error gyp verb install input version string "22.11.0"
npm error gyp verb install installing version: 22.11.0
npm error gyp verb install --ensure was passed, so won't reinstall if already installed
npm error (node:9144) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
npm error gyp verb install version is already installed, need to check "installVersion"
npm error gyp verb got "installVersion" 9
npm error gyp verb needs "installVersion" 9
npm error gyp verb install version is good
npm error gyp verb get node dir target node version installed: 22.11.0
npm error gyp verb build dir attempting to create "build" dir: C:\xampp\htdocs\node_modules\node-sass\build
npm error gyp verb build dir "build" dir needed to be created? C:\xampp\htdocs\node_modules\node-sass\build
npm error gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
npm error gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.Windows10SDK.19041
npm error gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
npm error gyp verb find vs2017 - Found Microsoft.VisualStudio.VC.MSBuild.Base
npm error gyp verb find vs2017 - Using this installation with Windows 10 SDK
npm error gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
npm error gyp verb build/config.gypi creating config file
npm error gyp verb build/config.gypi writing out config file: C:\xampp\htdocs\node_modules\node-sass\build\config.gypi
npm error gyp verb config.gypi checking for gypi file: C:\xampp\htdocs\node_modules\node-sass\config.gypi
npm error gyp verb common.gypi checking for gypi file: C:\xampp\htdocs\node_modules\node-sass\common.gypi
npm error gyp verb gyp gyp format was not specified; forcing "msvs"
npm error gyp info spawn C:\Python27\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\xampp\htdocs\node_modules\node-gyp\gyp\gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'msvs',
npm error gyp info spawn args '-G',
npm error gyp info spawn args 'msvs_version=2015',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\xampp\htdocs\node_modules\node-sass\build\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\xampp\htdocs\node_modules\node-gyp\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\uur\.node-gyp\22.11.0\include\node\common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=C:\Users\uur\.node-gyp\22.11.0',
npm error gyp info spawn args '-Dnode_gyp_dir=C:\xampp\htdocs\node_modules\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\Users\uur\.node-gyp\22.11.0\<(target_arch)\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=C:\xampp\htdocs\node_modules\node-sass',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'C:\xampp\htdocs\node_modules\node-sass\build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp: Undefined variable standalone_static_library in binding.gyp while trying to load binding.gyp
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: gyp failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.onCpExit (C:\xampp\htdocs\node_modules\node-gyp\lib\configure.js:345:16)
npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm error gyp ERR! System Windows_NT 10.0.19045
npm error gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\xampp\htdocs\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm error gyp ERR! cwd C:\xampp\htdocs\node_modules\node-sass
npm error gyp ERR! node -v v22.11.0
npm error gyp ERR! node-gyp -v v3.8.0
npm error gyp ERR! not ok
npm error Build failed with error code: 1
npm error A complete log of this run can be found in: C:\Users\uur\AppData\Local\npm-cache_logs\2024-11-08T21_55_18_236Z-debug-0.log

helpppp

@cclauss
Copy link
Contributor

cclauss commented Nov 8, 2024

npm error gyp ERR! node-gyp -v v3.8.0

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

4 participants