npm now requires users to approve builds, affecting cap's getting-started instructions

Open Beginner friendly
#551 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Domain
documentation

Research direction

Start with the getting-started page at https://capacitorjs.com/docs/getting-started and review the npm 11.16.0 installation flow described in the issue. Update the instructions to explain post-install script approval for packages such as esbuild and fsevents, including the relevant approval commands. Done means a new user can complete setup without missing these steps.

Written by the indexing model from the issue text.

Description

https://capacitorjs.com/docs/getting-started

npm ( as of npm 11.16.0 ) has been updated to now require manual post-install script approval, requiring additional steps when creating a capacitor project ( much like many other projects ) due to post install scrips from the esbuild and fsevents modules. It might be useful to make a not of this change in this page, eg

Note: as of npm version 11.16.0, some npm packages will require manual approval to run post-install scripts.

For reference, the entire process now looks like this:

➜ tmp npm init @capacitor/app@latest

> npx
> "create-capacitor-app"

✔ What is the name of your app?
 … foo
✔ What directory should be used for your app?
 … foo
✔ What should be the App ID for your app?

    App IDs (aka Bundle ID in iOS and Application ID in Android) are unique
    identifiers for apps. They must be in reverse domain name notation, generally
    representing a domain name that you or your company owns.

 … com.foo.online

🎉 Your Capacitor app is ready to go! 🎉

Next steps:
  - cd foo/
  - install dependencies (e.g. w/ npm install)
  - npm start
➜ tmp cd foo
➜ foo npm install

added 106 packages, and audited 107 packages in 6s

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

found 0 vulnerabilities
npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn allow-scripts   esbuild@0.27.7 (postinstall: node install.js)
npm warn allow-scripts
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.
➜ foo npm approve-scripts esbuild
Approved esbuild:
  added esbuild@0.27.7
➜ foo npm i @capacitor/android @capacitor/ios

added 3 packages, and audited 110 packages in 1s

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

found 0 vulnerabilities
npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn allow-scripts   fsevents@2.3.3 (install: (install scripts present))
npm warn allow-scripts
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.
➜ foo npm approve-scripts fsevents
Approved fsevents:
  added fsevents@2.3.3
Dominant language
MDX
Stars
48
Forks
794
Avg merge
2d 7h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ionic-team/capacitor-docs

All issues in ionic-team/capacitor-docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.