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

postinstall script fails #1953

Closed
RovshenTagangylyjov opened this issue Jan 23, 2022 · 4 comments
Closed

postinstall script fails #1953

RovshenTagangylyjov opened this issue Jan 23, 2022 · 4 comments

Comments

@RovshenTagangylyjov
Copy link

Environment

Ubuntu 20.04

Terminal

rovshen@Ubuntu:~/dev$ npm init vite@latest
✔ Project name: … vite-project
✔ Select a framework: › vue
✔ Select a variant: › vue-ts

Scaffolding project in /home/rovshen/dev/vite-project...

Done. Now run:

  cd vite-project
  npm install
  npm run dev

rovshen@Ubuntu:~/dev$ cd vite-project/
rovshen@Ubuntu:~/dev/vite-project$ npm install
npm ERR! code 1
npm ERR! path /home/rovshen/dev/vite-project/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rovshen/.npm/_logs/2022-01-23T09_47_52_065Z-debug-0.log

Log file tail

784 info run esbuild@0.13.15 postinstall node_modules/esbuild node install.js
785 info run esbuild@0.13.15 postinstall { code: 1, signal: null }
786 timing reify:rollback:createSparse Completed in 189ms
787 timing reify:rollback:retireShallow Completed in 0ms
788 timing command:install Completed in 35396ms
789 verbose stack Error: command failed
789 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
789 verbose stack     at ChildProcess.emit (node:events:390:28)
789 verbose stack     at maybeClose (node:internal/child_process:1064:16)
789 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
790 verbose pkgid esbuild@0.13.15
791 verbose cwd /home/rovshen/dev/vite-project
792 verbose Linux 5.13.0-27-generic
793 verbose argv "/snap/node/5770/bin/node" "/usr/local/bin/npm" "install"
794 verbose node v16.13.2
795 verbose npm  v8.3.1
796 error code 1
797 error path /home/rovshen/dev/vite-project/node_modules/esbuild
798 error command failed
799 error command sh -c node install.js
800 verbose exit 1
801 timing npm Completed in 35592ms
802 verbose unfinished npm timer reify 1642931272261
803 verbose unfinished npm timer reify:build 1642931307346
804 verbose unfinished npm timer build 1642931307348
805 verbose unfinished npm timer build:deps 1642931307348
806 verbose unfinished npm timer build:run:postinstall 1642931307366
807 verbose unfinished npm timer build:run:postinstall:node_modules/esbuild 1642931307366
808 verbose code 1
809 error A complete log of this run can be found in:

Also tried with pnpm and as the superuser, but got the same error.

@evanw
Copy link
Owner

evanw commented Jan 25, 2022

I can't reproduce this in my Ubuntu VM (Ubuntu 21.10):

$ npm init vite@latest
Need to install the following packages:
  create-vite@latest
Ok to proceed? (y) y
✔ Project name: … vite-project
✔ Select a framework: › vue
✔ Select a variant: › vue-ts

Scaffolding project in ./vite-project...

Done. Now run:

  cd vite-project
  npm install
  npm run dev

$ cd vite-project
$ npm install

added 110 packages, and audited 111 packages in 13s

16 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

As you can see it works fine for me. So I'm marking this as unactionable because there isn't realistically anything I can do about this since I can't reproduce it. However, you can help out by debugging this yourself. Here are instructions: #1711 (comment)

@evanw
Copy link
Owner

evanw commented Jan 31, 2022

There's a report that using node 17.4 fixes this issue: #1973 (comment). If someone who is able to reproduce this issue has the time to debug this, it would still be very useful to understand how far the install script gets before it fails and what's causing it to fail.

@evanw
Copy link
Owner

evanw commented Feb 2, 2022

I was finally able to reproduce this issue by installing node via snap (more info in #1711) and I pushed out a fix in version 0.14.17. Does the latest esbuild release fix these installation issues for you?

@evanw
Copy link
Owner

evanw commented Feb 2, 2022

I'm closing this as fixed since this fixed #1973 as well. Make sure all of your dependencies update to esbuild >= 0.14.17 as well.

@evanw evanw closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants