Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

npm hooks scripts breaks on windows #21

Closed
keenwon opened this issue Jun 17, 2018 · 1 comment
Closed

npm hooks scripts breaks on windows #21

keenwon opened this issue Jun 17, 2018 · 1 comment

Comments

@keenwon
Copy link

keenwon commented Jun 17, 2018

os: windows 7
node: 10.1.0
npm: 6.1.0 (npm-lifecycle@2.0.3)

.hooks\postinstall throw error:

> elint@1.4.0 postinstall C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\node_modules\elint
1087> C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\node_modules\.hooks\postinstall
1088'C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\node_modules\.hooks\postinstall' is not recognized as an internal or external command,
1089operable program or batch file.
1090npm WARN test-project@1.0.0 No description
1091npm WARN test-project@1.0.0 No repository field.
1092npm ERR! Windows_NT 10.0.14393
1093npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "C:\\projects\\elint\\elint-1.4.0.tgz"
1094npm ERR! node v6.14.2
1095npm ERR! npm  v3.10.10
1096npm ERR! code ELIFECYCLE
1097
1098npm ERR! elint@1.4.0 postinstall: `C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\node_modules\.hooks\postinstall`
1099npm ERR! Exit status 1
1100npm ERR! 
1101npm ERR! Failed at the elint@1.4.0 postinstall script 'C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\node_modules\.hooks\postinstall'.
1102npm ERR! Make sure you have the latest version of node.js and npm installed.
1103npm ERR! If you do, this is most likely a problem with the elint package,
1104npm ERR! not with npm itself.
1105npm ERR! Tell the author that this fails on your system:
1106npm ERR!     C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\node_modules\.hooks\postinstall
1107npm ERR! You can get information on how to open an issue for this project with:
1108npm ERR!     npm bugs elint
1109npm ERR! Or if that isn't available, you can get their info via:
1110npm ERR!     npm owner ls elint
1111npm ERR! There is likely additional logging output above.
1112
1113npm ERR! Please include the following file with any support request:
1114npm ERR!     C:\Users\appveyor\AppData\Local\Temp\1\elint_test_system_1529173406888\npm-debug.log
1115

file node_modules\.hooks\postinstall:

#!/usr/bin/env node

'use strict';

process.on('uncaughtException', (err) => {
  console.log(err);
  process.exit(0);
});

const { installFromScripts } = require('elint');
const packageName = process.env.npm_package_name;
const packageNameRegexp = /^(@.+\/)?elint-preset-.+/;

if (packageName && packageNameRegexp.test(packageName)) {
  installFromScripts(packageName);
}
@keenwon
Copy link
Author

keenwon commented Jun 17, 2018

Sorry, please ignore.

@keenwon keenwon closed this as completed Jun 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant