Per my test, it worked on me. Could you please share your spfx version?
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"
Steps to reproduce
- gulp clean
- gulp build
- gulp bundle --ship (or) gulp bundle
- gulp package-solution --ship (or) gulp package-solution
Thanks in Advance
3 answers
Sort by: Most helpful
-
-
MichaelHan-MSFT 18,021 Reputation points
2021-05-26T08:22:07.723+00:00 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. -
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.