0

Is there a way I can set a custom NPM repository to be used by JSS when running a jss deploy? I have a package dependency which is hosted in a dev repository (for the moment) and this is breaking my jss deploy...

cross-env-shell PUBLIC_URL=$npm_package_config_sitecoreDistPath "react-scripts build"

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
Failed to compile.
Cannot find module: '@hsantos/hsantos-module'. Make sure this package is installed.
You can install this package by running: npm install @hsantos/hsantos-module.

However, when I run npm config set @hsantos:registry https://npm.dev.cloud.hsantos.com + npm install @hsantos/hsantos-module the module is installed properly...

That leads me to think that during the jss deploy somehow the npm install is called but my custom NPM repository https://npm.dev.cloud.hsantos.com is not being taken into account.

2

Neither jss deploy app nor jss deploy files run npm install.

jss deploy app is an alias for jss deploy items and jss deploy files.

jss deploy files will, by default, run jss build before copying files to a local Sitecore instance.

jss build will, in turn, effectively run npm run build:client, which runs react-scripts build and is seemingly where your error is being generated.

You may want to try troubleshooting by directly running npm run build:client and working your way from there. The cannot find module error message you're receiving is originating from webpack when it is trying to build your app bundle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.