TooTallNate / node-lame

Node.js native bindings to libmp3lame & libmpg123
MIT License
567 stars 113 forks source link

Can't get this to install on MacOS Sierra w/ Node v8.11.3 & npm 6.1.0 #87

Closed Kezzsim closed 6 years ago

Kezzsim commented 6 years ago

So I was very excited to use this repository with icy to get PCM streams from icecast / shoutcast, and I was mainly thinking of using it as part of a redistributable open source package on npm because it bundled the codec which is great. The only difficulty I'm having is that presently when I attempt sudo npm install lame on my own system I'm presented with a host of problems I've never encountered before:

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/KariBarry/strayve/node_modules/lame/build'
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/KariBarry/strayve/node_modules/lame
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Okay, so let me get this straight: sudo doesn't give me the permissions I need to make the build directory? I tried the same thing from a root user shell and got similar results.

in the same error prompt I also get this about two dependencies:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lame@1.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the lame@1.2.4 install script.

The best thing I could think of was to try and install both of those manually so I attempted sudo npm install node-gyp rebuild which according to NPM's internal security prompt was a little problematic:

+ node-gyp@3.7.0
+ rebuild@0.1.2
updated 2 packages and audited 545 packages in 4.209s
found 4 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

even after installing these dependencies I get the exact same error noted above.

Any ideas?

Thanks

LinusU commented 6 years ago

Please never use sudo with npm, it leads to a world of pain 🙈

node-gyp should have been installed together with your installation of Node.js, you shouldn't have to install that manually.

You also installed a package named rebuild which I have no idea what it is. But that package is probably the one causing the security problems.

What OS are you running?

Kezzsim commented 6 years ago

Oh,

I'm running High Sierra; and I seem to have gotten it to install correctly with npm install lame after uninstalling rebuild which was a dependency of Optomist, a package which I am no longer using.

I can close the issue now, Thanks!

-Kb