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

fix: npm 20+ install #1602

Merged
merged 2 commits into from
Jun 9, 2024
Merged

Conversation

davidnixon
Copy link
Collaborator

@davidnixon davidnixon commented Jun 3, 2024

Contributes to #1576

What did you do?

Possible fix for npm 20+ install issues.

Why did you do it?

  • renamed prepare.js to devPreinstall.js to better account for how it is used. (Name inspired pnpm lifecycle script.)
  • Do not throw error in devPreinstall.js. Instead, issue warning.
  • Try catch operations in .storybook/postinstall.js & log successful completion
  • Add "node" in front of "ibmtelemetry". This should not be needed since node_modules/.bin/ibmtelemetry includes "#!/usr/bin/env node". But experimentally, this is required at least by npm 20+

How have you tested it?

See "this fails" steps in #1576
carbon-vue-3.0.15-4a6cf.tgz

npm 10 with node 20+

nvm use 20 # - Now using node v20.13.1 (npm v10.5.2)
npm create vite@latest app-name -- --template vue
cd add-name
npm install
# Ensure that Vue app itself is running.
Run npm add ./carbon-vue-3.0.15-4a6cf.tgz

pnpm

nvm use 20 # - Now using node v20.13.1 (npm v10.5.2)
npm create vite@latest app-name-pnpm -- --template vue
cd add-name-pnpm
pnpm i
# Ensure that Vue app itself is running.
Run pnpm add ./carbon-vue-3.0.15-4a6cf.tgz

yarn

nvm use 20 # - Now using node v20.13.1 (npm v10.5.2)
npm create vite@latest app-name-yarn -- --template vue
cd add-name-yarn
yarn
# Ensure that Vue app itself is running.
Run yarn add ./carbon-vue-3.0.15-4a6cf.tgz

direct install npm 10 with node 20+ on macos & Ubuntu 22

nvm use 20 # - Now using node v20.13.1 (npm v10.5.2)
tar -xf carbon-vue-3.0.15-1c45c.tgz
cd package 
npm install --omit=dev

@carbon/vue@3.0.15 postinstall
npx ibmtelemetry --config=telemetry.yml || true

Log file: /var/folders/x7/_hxvmlq51p36m3h6x4zm6r6r0000gn/T/ibmtelemetry-20240609T151905131Z-405315.log

added 47 packages, and audited 48 packages in 1m

9 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Were docs updated if needed?

  • N/A

@morpheux
Copy link

morpheux commented Jun 6, 2024

@davidnixon works for me.

image

@davidnixon davidnixon merged commit de71c59 into carbon-design-system:main Jun 9, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants