webassembly icon indicating copy to clipboard operation
webassembly copied to clipboard

How to install in Docker?

Open mcandre opened this issue 6 years ago • 1 comments

Hi, I can install packages with npm most of the time, but when I run npm install -g webassembly in a Docker container from library/debian:buster, then I get an error at the end of the installation:

# npm install -g webassembly
npm WARN npm npm does not support Node.js v10.15.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN deprecated [email protected]: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
/usr/local/bin/wa -> /usr/local/lib/node_modules/webassembly/bin/wa
/usr/local/bin/wa-compile -> /usr/local/lib/node_modules/webassembly/bin/wa-compile
/usr/local/bin/wa-assemble -> /usr/local/lib/node_modules/webassembly/bin/wa-assemble
/usr/local/bin/wa-disassemble -> /usr/local/lib/node_modules/webassembly/bin/wa-disassemble

> [email protected] postinstall /usr/local/lib/node_modules/webassembly
> node scripts/setup

fs.js:115
    throw err;
    ^

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/webassembly/wa-tools-3287gDj9vAX5jff0.tmp'
    at Object.openSync (fs.js:439:3)
    at Object._createTmpFileSync [as fileSync] (/usr/local/lib/node_modules/webassembly/node_modules/tmp/lib/tmp.js:266:15)
    at Object.<anonymous> (/usr/local/lib/node_modules/webassembly/scripts/setup.js:18:16)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/setup`
npm ERR! Exit status 1

Any tips for resolution?

mcandre avatar Feb 14 '19 02:02 mcandre

You could try running as sudo sudo npm install -g webassembly. Or alternatively you could try to install it in a project, meaning you create a project with npm init -y and then install webassembly with npm install webassembly. To run commands that are locally installed you can use npx. So the command to compile becomes npx wa ....

Hope this helps.

mikeheddes avatar Mar 06 '19 16:03 mikeheddes