Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akeneo installation / NODE_PATH=node_modules not recognized / yarn run webpack Error

I have already asked this question on git (https://github.com/akeneo/pim-community-dev/issues/7191) but unfortunately nobody has answered me yet, thought I would try SO.

I follow-up the akeneo-install-instruction (pim-community-standard-v2.0) https://docs.akeneo.com/latest/install_pim/manual/installation_ce_archive.html#initializing-akeneo

yarn run webpack

https://github.com/akeneo/pim-community-dev/blob/2.0/webpack.config.js

Gives me an error:

$ yarn run sync && NODE_PATH=node_modules webpack --config $npm_package_config_source/webpack.config.js --env=prod warning package.json: No license field $ NODE_PATH=node_modules node $npm_package_config_check --source=$npm_package_config_source 'NODE_PATH' is not recognized as an internal or external command, operable program or batch file.

What am I doing wrong?

like image 205
Nico Lausch Avatar asked Jun 11 '26 01:06

Nico Lausch


1 Answers

First of all, if you're using windows you should remove this part NODE_PATH=node_modules. You should add this variable to your environment variables. There is already a question about it: Nodejs cannot find installed module on Windows?.

Second, if you trigger yarn, it goes to package.json and search for variable "scripts". Webpack doesn't know what is $npm_package_config_source and $npm_package_config_check. It looks like not initialized PHP variables, but I might be wrong. There are 2 variables in the package.json :

"config": {
    "source": "vendor/akeneo/pim-community-dev",
    "check": "vendor/akeneo/pim-community-dev/webpack/check-dependencies.js"
},

If so, you should change scripts variable in package.json to this:

"scripts": {
    "sync": "node vendor/akeneo/pim-community-dev/webpack/check-dependencies.js --source=vendor/akeneo/pim-community-dev",
    "webpack": "yarn run sync && webpack --config vendor/akeneo/pim-community-dev/webpack.config.js --env=prod",
    "webpack-dev": "yarn run sync && webpack --config vendor/akeneo/pim-community-dev/webpack.config.js",
    "webpack-watch": "yarn run sync && webpack --progress --config vendor/akeneo/pim-community-dev/webpack.config.js --watch"
},
like image 130
Hevyweb Avatar answered Jun 19 '26 06:06

Hevyweb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!