1

I am trying to install NPM on a repository that I have locally cloned from GitHub. This is the error that I receive. Please let me know what I should do to resolve this.

Thank You!

npm ERR! path D:\Avin Dev\portfolio\node_modules\fibers
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.14.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Program Files\Python38\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:399:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Avin Dev\\portfolio\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd D:\Avin Dev\portfolio\node_modules\fibers
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! node-gyp exited with code: 1
npm ERR! Please make sure you are using a supported platform and node version. If you
npm ERR! would like to compile fibers on this machine please make sure you have setup your
npm ERR! build environment--
npm ERR! Windows + OS X instructions here: https://github.com/nodejs/node-gyp
npm ERR! Ubuntu users please run: `sudo apt-get install g++ build-essential`
npm ERR! RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
npm ERR! Alpine users please run: `sudo apk add python make g++`
npm ERR! 'nodejs' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in:
  • 'nodejs' is not recognized as an internal or external command – אברימי פרידמן Feb 12 '22 at 19:00
  • @אברימיפרידמן thanks for pointing that out, I already have node js installed, anything else I should do or check on? – Avin Indrasoma Feb 12 '22 at 19:20
  • `npm` is normally installed with Node, so if you have Node, it's already installed. Are you actually trying to install a *package* with `npm install`? What's the command you used for the error above? – tony19 Feb 12 '22 at 19:23
  • Possible duplicate of https://stackoverflow.com/questions/35293117/npm-install-that-requires-node-gyp-fails-on-windows – Estus Flask Feb 12 '22 at 20:17

1 Answers1

1

When a binary package is used in compatible environment, usually a precompiled binary is installed. That NPM tries to compile it is a sign that a combination Node version, CPU architecture and OS isn't supported by specified version of a binary package. fibers is a binary package known to be incompatible with Node 16.

One option is to modify the project to not depend on fibers. In the context of Vue it's likely node-sass that depends on fibers and it needs to be migrated to sass.

Another option is to downgrade to Node 14 and install the project as is.

Estus Flask
  • 206,104
  • 70
  • 425
  • 565