Open Daveke7 opened 6 years ago
Is this your package-lock.json file? And if so are you trying to install your app using npm install?
@lakefox yes this is my package.json and i get a premature close when running npm install.
I am having a similar issue.
Running npm install
would yield the following error:
npm ERR! premature close
I also had one git dependency in my package.json
. Removing it allowed npm install
to run without error.
EDIT:
I also have control over the git repo I was trying to install and found out there was an error in the version number for the package.json
. It contained leading zeroes. Fixing the version number to comply with the semver
spec fixed the install issue.
@Daveke7
Try yarn install
.
It worked for me with the same package.json
Also getting this exact same issue.
We did have things working with GitHub private repos, but once we moved to GitLab we began getting the npm ERR! premature close
.
yarn
also fails, with:
Output:
at ProcessTermError.ExtendableBuiltin (/opt/yarn-v1.7.0/lib/cli.js:243:66)
at ProcessTermError.MessageError (/opt/yarn-v1.7.0/lib/cli.js:272:123)
at new ProcessTermError (/opt/yarn-v1.7.0/lib/cli.js:312:113)
at ChildProcess.<anonymous> (/opt/yarn-v1.7.0/lib/cli.js:30299:17)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close [as _onclose] (net.js:595:12)
error Command failed.
Exit code: 1
We can git clone
the repos in both GitHub AND GitLab, they just fail when invoking either npm install
or yarn install
.
...so for us, it seems GitLab specific only when using npm/yarn.
We've done some more testing, and run into the same, or similar issues with:
git+ssh://git@gitlab.com:<name>/<project>
http://<gitlab_token_user>:<gitlab_token_value>@gitlab.com/<name>/<project>
http://gitlab.com/<name>/<project>
Same here with https://github.com/chinchang/web-maker/
npm http fetch GET 200 https://registry.npmjs.org/ecc-jsbn 51ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/bcrypt-pbkdf 51ms (from cache)
npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 16998ms
npm verb stack Error: premature close
npm verb stack at PassThrough.onclose (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\mississippi\node_modules\end-of-stream\index.js:47:67)
npm verb stack at PassThrough.emit (events.js:187:15)
npm verb stack at emitCloseNT (internal/streams/destroy.js:59:8)
npm verb stack at process._tickCallback (internal/process/next_tick.js:63:19)
npm verb cwd C:\Users\Daniel\GITHUB\web-maker
npm verb Windows_NT 10.0.17134
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Daniel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "--verbose"
npm verb node v10.2.1
npm verb npm v6.1.0
npm ERR! premature close
npm verb exit [ 1, true ]
npm timing npm Completed in 18020ms
A node mdoule / dependency was the cause here too, also a GitHub one which does not have a package.json.
I'm opening this issue because:
What's going wrong?
Whenever i try to install or update NPM into my project folder i get a premature close.
How can the CLI team reproduce the problem?
logs for the error https://gist.github.com/Daveke7/9ac9cb2d68b4a2c0ca2f28bfdc521141
supporting information:
npm -v
prints: 6.1.0-next.0node -v
prints: v10.0.0npm config get registry
prints: https://registry.npmjs.org/