Skip to content

Commit

Permalink
fix: error in projects without both deps and devDeps
Browse files Browse the repository at this point in the history
  • Loading branch information
justintaddei committed Nov 7, 2023
1 parent cbf00f3 commit 6071008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nuxt/v3/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path')

const pkg = require(path.join(process.env.INIT_CWD, 'package.json'))

const nuxtVersion = pkg.dependencies.nuxt ?? pkg.devDependencies.nuxt
const nuxtVersion = pkg.dependencies?.nuxt ?? pkg.devDependencies?.nuxt

if (!nuxtVersion || /2\.\d+\.\d+/.test(nuxtVersion)) {
process.exit(0)
Expand Down

0 comments on commit 6071008

Please sign in to comment.