Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm package fails to install when you don't have yarn installed #274

Closed
evmar opened this issue Jul 19, 2020 · 1 comment
Closed

npm package fails to install when you don't have yarn installed #274

evmar opened this issue Jul 19, 2020 · 1 comment

Comments

@evmar
Copy link

evmar commented Jul 19, 2020

I have a node binary but no npm binary, and the postinstall (?) of the esbuild module consequently fails.

In case it's relevant this is on a WSL system that is running Alpine Linux.

$ yarn add -D esbuild
yarn add v1.19.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/evmar/smash/web/node_modules/esbuild: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /home/evmar/smash/web/node_modules/esbuild
Output:
/bin/sh: npm: not found
child_process.js:660
    throw err;
    ^

Error: Command failed: npm install --silent --prefer-offline --no-audit --progress=false esbuild-linux-64@0.6.3
    at checkExecSyncError (child_process.js:621:11)
    at Object.execSync (child_process.js:657:15)
    at installBinaryFromPackage (/home/evmar/smash/web/node_modules/esbuild/install.js:33:17)
    at installOnUnix (/home/evmar/smash/web/node_modules/esbuild/install.js:71:5)
    at Object.<anonymous> (/home/evmar/smash/web/node_modules/esbuild/install.js:117:5)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) {
  status: 127,
  signal: null,
  output: [ null, null, null ],
  pid: 7350,
  stdout: null,
  stderr: null
}
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
@evmar
Copy link
Author

evmar commented Jul 19, 2020

I apologize in advance because I know the sort of hassle bugs like this can be (fiddling with npm is not your goal in esbuild).

A workaround for now is yarn add -D esbuild-linux-64 because I am unlikely to touch this project on a non-Linux system.

evmar added a commit to evmar/smash that referenced this issue Jul 19, 2020
We must still use TypeScript to build the code
that runs under node, because esbuild somehow
eats the puppeteer import (something about the
behavior of esModuleInterop?).

But for the web-facing bit, we can go direct from
TS to a bundle quickly enough that we can drop a
bunch of build machinery.  Delightful.

Also the package.json is a workaround for
evanw/esbuild#274
@evanw evanw closed this as completed in 8da1b58 Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant