21

i am trying to install all dependencies using npm install command, but while installing it i am getting error like below :

ling source file ..\src\threaded_callback_invokation.cc)
c:\applatest\applatest\node_modules\nan\nan.h(1478): warning C4996: 'node::MakeCallback': was declared deprecated (comp
iling source file ..\src\threaded_callback_invokation.cc) [C:\appLatest\appLatest\node_modules\voicemeeter\node_modules
\ffi\build\ffi_bindings.vcxproj]
  c:\users\alliancetek\.node-gyp\10.15.0\include\node\node.h(176): note: see declaration of 'node::MakeCallback' (compi
  ling source file ..\src\threaded_callback_invokation.cc)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\appLatest\appLatest\node_modules\voicemeeter\node_modules\ffi
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-linux@1.3.1 (node_modules\7zip-bin-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-linux@1.3.1: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@1.0.1 (node_modules\7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffi@2.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi@2.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\alliancetek\AppData\Roaming\npm-cache\_logs\2019-02-05T10_40_31_378Z-debug.log

in many of solutions i got try npm install node-gyp or uninstall or install it again but in that i am getting same error.

Also try with this steps:

  • Install the latest versions of Python (it may not be related), and "Microsoft Visual C++ Redistributable for Visual Studio 2017", and of course, Node.js and NPM;
  • As Admin: $ cd "C:\Program Files\nodejs\node_modules\npm" $ npm install node-gyp
  • $ npm config set msvs_version 2015 --global Note that I have VS 2017, but configuring it as ver 2017 won't work. Not sure why.
  • As Admin: $ npm install -g node-sass And finally, one last check: $ node-sass -v

and try with npm install --production windows-build-tools but getting no result by any option.

tried with every solution but none of the working. i have installed python with 2.7.15, vc++ building tools, visual studio 2017 and all required components.

I am finding solution from last 2 weeks please suggest me correct answer

molamk
  • 4,076
  • 1
  • 13
  • 22
sejal
  • 221
  • 1
  • 2
  • 4
  • Please specify which dependencies you are trying to install. If multiple try to isolate the package which fails to install. – Mathyn Feb 05 '19 at 11:06
  • my project is in aurelia js. so thats why i have added aurelia question. if i have added then it have some meaning @avrahamcool – sejal Feb 05 '19 at 11:21
  • i am only trying to install "npm install" command because without that i am not able to install any dependencies and i am facing issue in "npm install" command itself @Mathyn – sejal Feb 05 '19 at 11:22
  • If you run `npm install` you are installing dependencies based on a package.json part of the project. Please share this package.json with us. – Mathyn Feb 05 '19 at 12:17
  • here you can check my package.json file : https://www.dropbox.com/s/tobs3ci886fm47p/pacakge.txt?dl=0 – sejal Feb 05 '19 at 12:36

5 Answers5

27
  1. run: npm cache clean --force
  2. delete node_modules
  3. delete packagelock.json and yarn.lock(if have)
  4. run: npm install
Maxim Pyshko
  • 551
  • 4
  • 14
Shubham Tiwari
  • 1,761
  • 11
  • 19
  • 2
    i have follow same steps but getting same error. here my logs are putting in one file – sejal Feb 05 '19 at 11:47
  • you can check logs here : https://www.dropbox.com/s/txaccpwda6t7n5m/logs.txt?dl=0 – sejal Feb 05 '19 at 11:55
  • 2
    Delete the ~/.node-gyp folder and then the ~/.npmrc file. Reboot your server and rerun npm install in your project folder **and please check the server node version package.json file than what your local environment was running. So check what you are running locally with:** – Shubham Tiwari Feb 05 '19 at 12:16
  • 2
    and please refer this ,it will help you [ https://stackoverflow.com/questions/52089305/gyp-err-stack-error-c-program-files-x86-msbuild-14-0-bin-msbuild-exe ] – Shubham Tiwari Feb 05 '19 at 12:19
  • i have delete "node-gyp" folder from path : C:\appLatest\appLatest\node_modules\npm\node_modules and delete "npmrc" from path " C:\appLatest\appLatest\node_modules\npm\html\doc\files". let me know if i have choose wrong path. i am not clear with version check concept. how can i check that? – sejal Feb 05 '19 at 12:29
  • for your given link, i have already check and tried but it is also not working for me :( i have no idea that what i am missing and where – sejal Feb 05 '19 at 12:31
  • have you specified any version in package.json like { "engines" : { "node" : "8.0.0 " } } than make sure your current node version is which specified in packge.json .than run npm install – Shubham Tiwari Feb 05 '19 at 12:34
  • you can check package.json file here : https://www.dropbox.com/s/tobs3ci886fm47p/pacakge.txt?dl=0 because i have no any parameter like this – sejal Feb 05 '19 at 12:37
  • put "ffi": "*" in package.json than try npm install – Shubham Tiwari Feb 05 '19 at 12:46
  • i have tried with this and getting another type of error : here you can find my logs : https://www.dropbox.com/s/bbdtkgeighixkf8/log.txt?dl=0 – sejal Feb 05 '19 at 12:58
  • A new package will do all of this for us now. Make sure you have the sufficient permissions by running: **Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force** then run: **npm install -g windows-build-tools** wait for it to install and then run: **window-build-tools** and everything should be in its finest order. if this won't work update your package.json modules with latest versions. – Shubham Tiwari Feb 05 '19 at 13:08
  • after install this command getting same error : you can check logs here : https://www.dropbox.com/s/vu5cfuz5jxk9xe7/log_cors.txt?dl=0 – sejal Feb 05 '19 at 13:11
  • i have tried with "npm install -g windows-build-tools" as your given steps but i am getting still same error. for the latest version module how can i update that all packages because i am not installing any packages to my project – sejal Feb 05 '19 at 13:17
  • I searched in github, and stackoverflow until i found your answer ! thank you a lot you saved my life :) – sohaieb azaiez Dec 22 '19 at 12:50
  • i tried same but still failed to run npm install my question here : https://stackoverflow.com/questions/60613405/npm-install-issues-found-during-obdx-android-app-development – Erum Mar 10 '20 at 16:52
  • 1
    no didnt work for me. everything is same as last one . this is my repo that have this error https://github.com/llighter/ionic-studycard – saber tabatabaee yazdi May 25 '20 at 21:18
5

None of these answers worked for me on Windows 10 and Node 13. I had to uninstall Visual Studio and Build Tools, and uninstall Node 13. Then, I deleted npm and npm-cache from Roaming, before reinstalling Node 11.6 and choosing to install Chocolately. It worked for me thereafter.

user5305519
  • 3,008
  • 4
  • 26
  • 44
  • 2
    I faced the same on Win 10 - the problem was again the version of node. I installed a node version manager for windows : https://github.com/coreybutler/nvm-windows/releases Then I installed v. 10 (as this was for an Ang7 project, I had v. 12 before that): nvm install 10 nvm use 10.0.0 And this resolved the problem. With the manager you can quickly switch node versions if you're working in multiple repos. – Albena Kertova Mar 20 '20 at 13:58
  • 1
    Mine worked after I downgraded to Node 10.x. Nothing else I tried actually worked. – Rupam Apr 30 '21 at 08:34
  • 2
    yes this worked for me, apparently when i ticked the checkbox that asks to install chocolaty and other c++ libraries it downloaded whatever the heck was missing and i was able to do `npm install` – some_groceries Mar 28 '22 at 08:59
3
  • Run npm install --production windows-build-tools might take longer to install, worked for my friend

OR

  • Reinstalling nodeJs worked for me
Debu Shinobi
  • 2,057
  • 18
  • 21
1

You can try downgrading Node.js to an older version, i was using version v14.16.1LTS. After switching to v10.24.1 it worked.

To change your node version check How to change to an older version of Node.js

Remember to first remove your node_modules folder and package-lock.json or yarn.lock

You can also try switching from yarn to npm or npm to yarn.

Alejov
  • 464
  • 6
  • 14
0

Run below command in cmd with administrator priviledges:

npm install --global --production windows-build-tools --vs2017
realr
  • 3,652
  • 6
  • 23
  • 34
  • 5
    Thank you for this suggestion, which might provide some limited short-term help. A proper explanation [would greatly improve](//meta.stackexchange.com/q/114762) its long-term value by showing *why* this is a good solution to the problem, and would make it more useful to future readers with other, similar questions. Please [edit] your answer to add some explanation, including the assumptions you've made. – Toby Speight Aug 21 '19 at 16:18