I have recently come across an issue with npm and my Windows 10 PC at my development job that I can’t resolve and I’m hoping someone here can point me in the right direction.
My development stack is as follows:
XAMPP (latest version - currently 7.2.8)
Node.js - 10.8.0
npm - 6.2.0
phpstorm - 2018.2
I am trying to perform the following:
- Create a laravel application with "composer create-project --prefer-dist laravel/laravel " - this works
- Navigate into the laravel app directory and run “npm install” - this fails with the error message pasted below.
I can successfully perform these actions on other machines as follows:
- My home PC – A Windows 10 machine, not connected to the work infrastructure at all
- A Win10 VM in ESXi – Has no group policy or antivirus that might conflict, but same network policies
- On a co-workers PC – A domain Win10 PC configured with the same policies as my workstation
I have also tried installing this under a different user profile on the same physical workstation. It also failed in that instance. So I am fairly confident the issue is related to this Win10 PC.
I have uninstalled all parts of the development stack mentioned above and re-installed them, but the behavior does not change.
All of the answers I found via Googling (mostly stackexchange) point to solutions for an Ubuntu system related to installing libpng-dev, however no solutions on how to resolve for Windows 10. Any help or guidance would be very appreciated.
> firstname.lastname@example.org postinstall C:\xampp\htdocs\nodetestapp\node_modules\pngquant-bin > node lib/install.js ‼ Client network socket disconnected before secure TLS connection was established ‼ pngquant pre-build test failed i compiling from source √ pngquant pre-build test passed successfully × Error: pngquant failed to build, make sure that libpng-dev is installed at Promise.all.then.arr (C:\xampp\htdocs\nodetestapp\node_modules\pngquant-bin\node_modules\bin-build\node_modules\execa\index.js:231:11) at process._tickCallback (internal/process/next_tick.js:68:7) npm verb lifecycle email@example.com~postinstall: unsafe-perm in lifecycle true npm verb lifecycle firstname.lastname@example.org~postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin... [truncated] npm verb lifecycle email@example.com~postinstall: CWD: C:\xampp\htdocs\nodetestapp\node_modules\pngquant-bin npm timing audit submit Completed in 1274ms npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1273ms npm timing audit body Completed in 0ms npm info lifecycle firstname.lastname@example.org~postinstall: Failed to exec postinstall script npm timing action:postinstall Completed in 64605ms npm verb unlock done using C:\Users\t.frappier\AppData\Roaming\npm-cache\_locks\staging-75dd9ecf86d3f9ca.lock for C:\xampp\htdocs\nodetestapp\node_modules\.staging npm timing stage:rollbackFailedOptional Completed in 145ms npm timing stage:runTopLevelLifecycles Completed in 69718ms npm verb stack Error: email@example.com postinstall: `node lib/install.js` npm verb stack Exit status 1 npm verb stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16) npm verb stack at EventEmitter.emit (events.js:182:13) npm verb stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) npm verb stack at ChildProcess.emit (events.js:182:13) npm verb stack at maybeClose (internal/child_process.js:962:16) npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:249:5) npm verb pkgid firstname.lastname@example.org npm verb cwd C:\xampp\htdocs\nodetestapp npm verb Windows_NT 10.0.16299 npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--verbose" npm verb node v10.8.0 npm verb npm v6.2.0 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! email@example.com postinstall: `node lib/install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the firstname.lastname@example.org postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm verb exit [ 1, true ] npm timing npm Completed in 70602ms npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\t.frappier\AppData\Roaming\npm-cache\_logs\2018-08-09T15_27_44_536Z-debug.log