Issue
- Error as "ReferenceError: primordials is not defined" is thrown either while upgrading a theme or when importing a theme
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 and higher
Resolution
Please Note: The following steps involve third-party tool that lies beyond the scope of Liferay Support. Please exercise appropriate discretion in the use of this information.
- Installing the specific node version resolves the primordial error. Please refer to the below steps.
Steps to follow:
- Install the specific node version [For ex: v10.15.1]
home/xxxx/yyyyy/theme$ sudo n 10.15.1
- Then try to import a theme or upgrade a theme.
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