Error on "package-solution" with SharePoint 2016 onwards, including 2019 and SharePoint Online

Navazee Shaik Mohammed 1 Reputation point
2021-05-24T12:44:24.28+00:00

Getting errors while packaging using "gulp package-solution --ship" & "gulp package-solution"
99161-error2.png

Steps to reproduce

  1. gulp clean
  2. gulp build
  3. gulp bundle --ship (or) gulp bundle
  4. gulp package-solution --ship (or) gulp package-solution

Thanks in Advance

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,767 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MichaelHan-MSFT 18,021 Reputation points
    2021-05-25T09:58:07.907+00:00

    Hi @Navazee Shaik Mohammed ,

    Per my test, it worked on me. Could you please share your spfx version?


  2. MichaelHan-MSFT 18,021 Reputation points
    2021-05-26T08:22:07.723+00:00

    Hi @Navazee Shaik Mohammed ,

    I notice that your node version is v10 and gulp version is v4. However, gulp v4 isn't supported with Node.js v10.

    You could refer to this article: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/release-1.12.1#gulp-versions--nodejs-v12

    If you're using Node.js v12+ or higher, you must use Gulp v4+. If you're using a version of Node.js lower than v12, you must use Gulp v3.

    Please try to upgrade your node version and try again


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Navazee Shaik Mohammed 1 Reputation point
    2021-05-28T17:23:08.18+00:00

    Some of the observation regarding above issue.

    At my end, while configuring webpart using SPFx-on-premises.

    observation : after (8:Run npm install) typescript in below section is still unchanged(still pointing to typescript version 2.2.2 instead of 3.6.4 at below section in "package-lock.json" file.

    "node_modules/typescript": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.2.2.tgz", "integrity": "sha1-YGAiUIR5tV/6NotY/uljoD39eww=", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }

    After:

    "node_modules/typescript": { "version": "3.6.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz", "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }

    I manually changed to 3.6.4 and run "npm Install" once again. it create package without any issues.

    2.I'm able to package solution successfully for first time only. second time I'm getting same error()?
    Any ideas to overcome this issue.

    0 comments No comments