question

NavazeeShaik-1665 avatar image
0 Votes"
NavazeeShaik-1665 asked NavazeeShaik-1665 answered

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

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-dev
error2.png (276.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

NavazeeShaik-1665 avatar image
0 Votes"
NavazeeShaik-1665 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered NavazeeShaik-1665 commented

Hi @NavazeeShaik-1665 ,

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://docs.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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I tried with Gulp v3, but getting same error.

+-- @microsoft/generator-sharepoint@1.12.1
+-- gulp-cli@2.3.0
+-- gulp-v3@3.12.1
+-- npm@7.10.0
+-- rimraf@3.0.2
+-- touch-cli@0.0.1
+-- typescript@3.9.6
`-- yo@3.1.1

99896-capture3.png


0 Votes 0 ·
capture3.png (99.9 KiB)
MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered NavazeeShaik-1665 commented

Hi @NavazeeShaik-1665 ,

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







· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Additional environment details
C:\Users\ABC\AppData\Roaming\npm
+-- @microsoft/generator-sharepoint@1.12.1
+-- gulp@4.0.2
+-- npm@7.10.0
+-- rimraf@3.0.2
+-- typescript@3.9.6
`-- yo@3.1.1

Installed below package:
npm install @pnp/sp –save
npm install @pnp/spfx-controls-react –save
npm install --save @types/jquery
npm install --save @types/jqueryui

0 Votes 0 ·