question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postinstall not fit for Windows

See original GitHub issue

Hi, since the update yesterday I can’t install my modules, since the postinstall script uses “||”, which isn`t supported on Windows in the given context.

`At line:1 char:53
+  node -e "try{require('./_postinstall')}catch(e){}" || exit 0
+                                                     ~~
The token '||' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine`

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ilyachalovcommented, Jul 4, 2022

@medikoo Thanks for the reply. I’ve already figured it out.

npm can be configured in command line:

> npm config set script-shell="pwsh"

And now I have succeeded (I also installed ‘PowerShell 7’):

windows10-pwsh-ok

Thanks again. 🎉🎉🎉

0reactions
mrJlicommented, Oct 15, 2022

npm version - 8.19.2 i try to install 8.12.1 and all works, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to use in postinstall script on Windows #88 - GitHub
Works fine on Linux. On Windows: node_modules/self was unexpected at this time. C:\Users\M0on75e1l\node_modules\some> ...
Read more >
Issues in npm post-install script - Stack Overflow
My project is based on Linux but due to issues i have to run the server from windows. Front end is supported by...
Read more >
Windows Server 2012 R2 Datacenter Post-Install - Error 0xc0000001
I successfully installed Windows Server 2012 Datacenter on my home server. ... Can someone confirm whether or not my machine meets the minimum...
Read more >
Using FOG Postinstall scripts for Windows Driver injection ...
In this tutorial we will create 2 new FOG postinstall scripts and update the ... -d /ntfs/WINDOWS ]]; then echo "Not found" umount...
Read more >
Running the postInstall Script Manually
Installation Guide for Microsoft SQL Server with IBM WebSphere ... postInstall.sh -Ddatabase.password=<MDM Hub Master Database Password>.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found