question

kocurek avatar image
kocurek asked kocurek commented

remote-pay-cloud and remote-pay-cloud-api scripts

Hello,

I have remote-pay-cloud and remote-pay-cloud-api dependencies in my package.json. The web app is Windows. When running npm i we get an error because the pre and post install scripts are not suitable for a Windows environment. How have others gotten around this?

  • Trent
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Mark Mullan avatar image
Mark Mullan Deactivated answered kocurek commented

npm i --ignore-scripts worked well for me. Can you confirm on your end as well?

Thanks for pointing this out, by the way. I'll relay it to the rest of the team.

Best,

Mark

6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kocurek avatar image kocurek commented ·

Hi Mark,

The application I am working on is a .NET web app. We use Grunt in our CI environment to minify, ugilfy, prefix, etc... With our Clover integration, I wanted to add webpack to the mix so that our builds automatically build our clover.js code. To do this, we would need to have the remote-pay-cloud and remote-pay-cloud-api packages added to the package.json so that NPM can't bring them down before running webpack. Problem is, npm install --ignore-script is a global argument and will ignore all scripts for all other dependencies which is not acceptable.

0 Likes 0 ·
Mark Mullan avatar image Mark Mullan commented ·

Hey there!

What does your package.json look like? Are there any specific webpack scripts that need to be run the instant that remote-pay-cloud is npm installed? (see package.json script lifecycle attributes)

For what it's worth, I was able to execute a regular npm i after first --ignoring-scripts. Seems like this would invoke the package.json scripts and continue as desired. Screencap shown. Please let me know if I'm missing something.

0 Likes 0 ·
Mark Mullan avatar image Mark Mullan commented ·

Extra notes:

  • --save flag would have added remote-pay-cloud to package.json and node_modules.
  • For academic purposes, it seems like the error is due to the fact that our remote-pay-cloud's package.json has a scripts attribute with some values pointing to file extensions like, "scripts/generateDocs.sh". Obviously this is fine on Mac, but Windows wants filepaths with \'s, not /'s.
  • After the npm i --ignore-scripts command, shouldn't a webpack command just build normally?
0 Likes 0 ·
kocurek avatar image kocurek commented ·

Running npm i remote-pay-cloud --save --ignore-script then running npm -i will work locally since you first install remote-pay-cloud. When deploying to a server that does not yet have remote-pay-cloud installed the build will simply run npm install --production without the initial install of remote-pay-cloud and cannot skip the scripts.

Steps: 1) rm -rf node_modules 2) Add remote-pay-cloud to package.json 3) npm i

The build server will not run npm i remote-pay-cloud --save --ignore-script.

0 Likes 0 ·
kocurek avatar image kocurek commented ·

600 characters is not ample space to explain the process. We are heading a different direction so this won't be an issue anymore. I will say that it is not great that someone building on Windows has to ignore scripts. I won't be the last to bring this up.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community