You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] npm not installing (all) optional dependencies #5831
npm does not install (all) optional dependencies by default
Expected Behavior
npm installs all optional dependencies by default
Steps To Reproduce
npm i @twurple/chat
npm ls --all
See output above:
UNMET OPTIONAL DEPENDENCY encoding@^0.1.0
UNMET OPTIONAL DEPENDENCY bufferutil@^4.0.1
UNMET OPTIONAL DEPENDENCY utf-8-validate@^5.0.2
If you install those packages (as optional dependencies) yourself and check the output again, it is fine.
Environment
npm: 8.19.2 (I know 8.19.3 is current but it is not included in node v18.12.1 which is current so...)
Node.js: v18.12.0
OS Name: Windows 10 21H1
System Model Name: custom pc
npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrcprefix = "C:\\Users\\[]\\AppData\\Roaming\\npm"; node bin location = C:\Program Files\nodejs\node.exe; node version = v18.12.0; npm local prefix = C:\Users\[]; npm version = 8.19.2; cwd = C:\Users\[]; HOME = C:\Users\[]; Run `npm config ls -l` to show all defaults.
@notroid5 Thanks for reporting this . This behaviour is actually intentional. npm does not install optional dependencies if: They are not compaitable with your current system(e.g, OS,CPU, or Node version) or
'They fail to install and are marked as optional in package.json`
Activity
v-kchindam-infy commentedon Jun 10, 2025
@notroid5 Thanks for reporting this . This behaviour is actually intentional. npm does not install optional dependencies if:
They are not compaitable with your current system(e.g, OS,CPU, or Node version)or'They fail to install and are marked as optional in package.json`