@microsoft/generator-SharePoint package.json should contain a lib folder in order to make path.resolve working.
In a project that has @microsoft/generator-sharepoint as a dependency installed. path.resolve does not work.
{
"name": "pathresel",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gulp": "^4.0.2"
},
"dependencies": {
"@angular/cli": "^8.3.21",
"@microsoft/generator-sharepoint": "^1.9.1"
}
}
The following script will fail because of the missing lib entry.
const path = require('path');
const msgen = require.resolve('@microsoft/generator-sharepoint');
console.log(msgen);

It causes issues in the PnP/generator using any other package manager and unit test other than npm.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Thanks for the report @StfBauer, I've committed a fix. This will be resolved next drop. cc: @patmill @VesaJuvonen
This was fixed in @microsoft/[email protected], see https://unpkg.com/browse/@microsoft/generator[email protected]/package.json. I believe this issue can be closed.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
Thanks for the report @StfBauer, I've committed a fix. This will be resolved next drop. cc: @patmill @VesaJuvonen