Sp-dev-docs: 馃悶 @microsoft/generator-sharepoint package.json misses lib entry

Created on 31 Dec 2019  路  4Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

@microsoft/generator-SharePoint package.json should contain a lib folder in order to make path.resolve working.

Observed Behavior

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);

Screenshot 2019-12-31 at 16 12 37

It causes issues in the PnP/generator using any other package manager and unit test other than npm.

Steps to Reproduce

  1. Create new npm package
  2. Install @microsoft/generator-sharepoint as a dependency
  3. Run the script above
generator fixed-next-drop bug-confirmed

Most helpful comment

Thanks for the report @StfBauer, I've committed a fix. This will be resolved next drop. cc: @patmill @VesaJuvonen

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings