I strongly agree with sompylasar answer and want to expand a little further on it. I really do think two different package.json files is the only way to do this.
Think of your frontend and your backend as two different applications. In two very different environments as well, and as such your packaging and build chain needs will be different as well.
The whole point of npm is to have isolated dependencies per package. You are going against that by sharing your dependency list with two entirely unrelated applications ( frontend and backend ).
Imagine hiring new front end developers and they want to upgrade some front end packages, now they have to go ahead and figure out how to run and or test the backend as well because they might break something there.
It might feel like it's a little more cumbersome to manage two package.json
files in the beginning, but this type of isolation will keep your app sane as it grows.
As such I would recommend a structure where you have two sibling folders with each their own package.json. Exactly how you want to structure that is up to you.
If you have core business logic you want to share between frontend and backend, then off course you can put that, in a separate npm package, which you can then reference in your backend and frontend package as a dependency.
You can use npm link
to develop against the same version simultaneously in your front and backend for development comfort.