legacy-knowledge-base
公開されました Sep. 10, 2025

"Primordial "テーマのアップグレードやインポート時にReferenceErrorが発生する

written-by

Thanga Meena

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • "ReferenceError: primordials is not defined" のようなエラーが、テーマのアップグレード時またはテーマのインポート時に発生します。
home/xxxx/yyyyy/theme$ yo liferay-theme:import
00h00m00s 0/0: : fs.js:27
const { Math, Object } = primordials;
^

ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (/usr/lib/node_modules/generator-liferay-theme/node_modules/natives/index.js:143:24)
at Object.req [as require] (/usr/lib/node_modules/generator-liferay-theme/node_modules/natives/index.js:55:10)

Environment

  • Liferay DXP 7.0以上

解決策

注意:以下の手順は、Liferay Supportの範囲外のサードパーティツールを使用します。 ご利用の際は、適切なご判断をお願いいたします。

  • 特定のノードバージョンをインストールすることで、 primordial のエラーが解消されます。 以下の手順をご参照ください。

ステップを踏んでいきます:

  • 特定のノードバージョンをインストールする [例: v10.15.1]
    home/xxxx/yyyyy/theme$ sudo n 10.15.1
  • その後、テーマのインポートやテーマのアップグレードを試してみてください。
home/xxxx/yyyyy/theme$ yo liferay-theme:import
00h00m00s 0/0: :
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the splendid |
`---------´ | Liferay Theme Importer |
( _´U`_ ) | generator! |
/___A___\ '--------------------------'
| ~ |
__'.___.'__
´ ` |° ´ Y `

? May generator-liferay-theme anonymously report usage statistics to improve the tool over time? Yes
? What theme would you like to import? /home/meena/Desktop/FIles_theme_upgrade/upgrade70/Theme61-70/Theme61/Theme61x-theme
Warning could not determine the property <template-extension> from /home/meena/Desktop/FIles_theme_upgrade/upgrade70/Theme61-70/Theme61/Theme61x-theme/docroot/WEB-INF/liferay-look-and-feel.xml. Using ftl as default value.
create package.json
create .gitignore
create gulpfile.js
create src/css/custom.css
create src/WEB-INF/liferay-look-and-feel.xml
create src/WEB-INF/liferay-plugin-package.properties
...............
? Enter the url to your production or development site: http://localhost:8080
[15:49:21] Finished 'plugin:init' after 1.37 min
[15:49:21] Starting 'init'...
[15:49:21] Finished 'init' after 54 μs
did-this-article-resolve-your-issue

legacy-knowledge-base