Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preinstall script not working on cmd / powershell #558

Closed
adam-lebon opened this issue Mar 9, 2018 · 2 comments
Closed

preinstall script not working on cmd / powershell #558

adam-lebon opened this issue Mar 9, 2018 · 2 comments

Comments

@adam-lebon
Copy link
Contributor

adam-lebon commented Mar 9, 2018

Case

Bug

Issue

When you install rxdb from a windows system with the default shells (cmd or powershell) the preinstall script is the following in the package.json:

"preinstall": "rm -f ./package-lock.json",

But in Windows system the -f argument does not exist on powershell. Worse, when you are using cmd the rm command simply doesn't exist (del is the equivalent)

Info

  • Environment: (windows)
  • Adapter: (N.A.)
  • Stack: (N.A.)

Step to reproduce

PS > yarn add rxdb
error C:\Users\****\Documents\Git\********\node_modules\rxdb: Command failed.
Exit code: 1
Command: rm -f ./package-lock.json
Arguments:
Directory: C:\Users\Adam\Documents\Git\NSRP-SERVER\node_modules\rxdb
Output:


*Blank output but the issue is that -f doesn't exist on powershell*

When you install the package they are no package lock so the rm command looks useless for fresh installation.

"""Solution"""

Use a cygwin / cmder / babun whatever, a shell emulator to get the rm command.

Fix

Check the utility of the rm command and remove if possible

@pubkey
Copy link
Owner

pubkey commented Mar 9, 2018

You are right. The preinstall-command was intended for dev-mode
I forgot that it will also run when rxdb is installed as dependency.

@pubkey
Copy link
Owner

pubkey commented Mar 11, 2018

Thx for the help. I released 7.4.1 with the fix.

@pubkey pubkey closed this as completed Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants