Skip to content

Commit

Permalink
fix(cli): pnpm npmrc (#2561 by @frankcalise @morganick)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcalise committed Nov 20, 2023
1 parent b5133a3 commit 4ae5c0b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,14 @@ module.exports = {
// #region Run Packager Install
// pnpm/yarn/npm/bun install it

// fix .npmrc if using pnpm
if (packagerName === "pnpm") {
// append `node-linker=hoisted` to .npmrc
const npmrcPath = path(targetPath, ".npmrc")
const npmrcContents = read(npmrcPath)
write(npmrcPath, `${npmrcContents}${EOL}node-linker=hoisted${EOL}`)
}

// check if there is a dependency cache using a hash of the package.json
const boilerplatePackageJsonHash = cache.hash(read(path(boilerplatePath, "package.json")))
const cachePath = path(cache.rootdir(), boilerplatePackageJsonHash, packagerName)
Expand Down

0 comments on commit 4ae5c0b

Please sign in to comment.