piper-audio/piper-js

Installation fails on Windows

cannam opened this issue · 2 comments

I made the schoolboy error of bringing a Windows laptop along with me today, and I thought I'd see how npm gets on with our packages on it. I'm running everything from Powershell (because that is the Windows Way) rather than trying to use the Windows Subsystem for Linux or whatever.

It doesn't work that well, it turns out. Although I could install most of the packages needed by ugly-duckling, piper fails because it explicitly tries to run Unix shell commands:

PS C:\Users\Chris\Documents\ugly-duckling> npm install

> piper@0.13.0 postinstall C:\Users\Chris\Documents\ugly-duckling\node_modules\piper
> npm run prepublish


> piper@0.13.0 prepublish C:\Users\Chris\Documents\ugly-duckling\node_modules\piper
> npm run clean && npm run build-src-only && cp -r dist/ts/* .


> piper@0.13.0 clean C:\Users\Chris\Documents\ugly-duckling\node_modules\piper
> rm -rf fft *.js *.js.map *.d.ts dist extractors client-stubs fft protocols servers

'rm' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "clean"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! piper@0.13.0 clean: `rm -rf fft *.js *.js.map *.d.ts dist extractors client-stubs fft protocols servers`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the piper@0.13.0 clean script 'rm -rf fft *.js *.js.map *.d.ts dist extractors client-stubs fft protocols servers'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the piper package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rm -rf fft *.js *.js.map *.d.ts dist extractors client-stubs fft protocols servers
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs piper
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls piper
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Chris\Documents\ugly-duckling\node_modules\piper\npm-debug.log

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "prepublish"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! piper@0.13.0 prepublish: `npm run clean && npm run build-src-only && cp -r dist/ts/* .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the piper@0.13.0 prepublish script 'npm run clean && npm run build-src-only && cp -r dist/ts/* .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the piper package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run clean && npm run build-src-only && cp -r dist/ts/* .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs piper
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls piper
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Chris\Documents\ugly-duckling\node_modules\piper\npm-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"
win32","arch":"x64"})
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! piper@0.13.0 postinstall: `npm run prepublish`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the piper@0.13.0 postinstall script 'npm run prepublish'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the piper package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run prepublish
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs piper
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls piper
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Chris\Documents\ugly-duckling\npm-debug.log

Ah, damn. Big oversight from me there.

Left as-is, this would actually work fine for a consumer of piper if I got rid of that "postinstall" script and published this to npm. Or included pre-compiled stuff in the repo which is quite common.

I'll have to script it for a more portable solution. The build process is pretty gross and could probably be simplified.

fwiw, the waves-ui bundle procedure had basically the same problem (it shelled out to "find" to pick up the files to transpile). That was also pretty gross anyway of course. I pushed a fix this morning.