Skip to content

fix: skip npm dev install - #58

Merged
guym4c merged 2 commits into
americanexpress:mainfrom
ddwivedi551:patch-1
Aug 4, 2026
Merged

fix: skip npm dev install#58
guym4c merged 2 commits into
americanexpress:mainfrom
ddwivedi551:patch-1

Conversation

@ddwivedi551

@ddwivedi551 ddwivedi551 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Problem

create-using-template's install-template.js runs npm install <template> --save from
inside its own package directory (__dirname). npm finds create-using-template/package.json
as the project root and resolves the full dependency tree — including devDependencies.

The chain semantic-release@^25@semantic-release/npmnpm@>=10 resolves to
npm@11.19.0, which Artifactory blocks with 403 (not yet approved). This breaks every time
a new npm version is published.

Fix

Add --omit=dev to the install args in src/utils/install-template.js:

const installTemplate = (templateName) => runNpmInstall(__dirname, [
  resolveLocalTarball(templateName),
  '--ignore-scripts',
  '--save',
  '--save-exact',
  '--omit=dev',
]);

Why it won't break

  • The installTemplate step only needs the template to be require()-able
  • Template's production deps (js-yaml, uuid, wordlist-english, node-fetch) are still installed
  • create-using-template's production deps (cross-spawn, prompts, ejs, etc.) are still installed
  • Skipped devDeps (semantic-release, commitlint, eslint, jest) are never require()d during generation
  • Step 5 (module install) runs separately in the generated project's directory, unaffected by this flag

Testing

git clone https://github.com/ddwivedi551/create-using-template.git
cd create-using-template
npm pack
npx --package ./create-using-template-1.12.3.tgz create-using-template @americanexpress/one-app-v7-module-template@latest

Updated test cases to include '--omit=dev' parameter in runNpmInstall calls.
@guym4c
guym4c merged commit 5fe5728 into americanexpress:main Aug 4, 2026
4 checks passed
oneamexbot added a commit that referenced this pull request Aug 4, 2026
## [1.12.3](v1.12.2...v1.12.3) (2026-08-04)

### Bug Fixes

* skip npm dev install ([#58](#58)) ([5fe5728](5fe5728))
@oneamexbot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.12.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants