Pm2: gkt package problem

Created on 28 Sep 2016  路  10Comments  路  Source: Unitech/pm2

Hi,

I'm trying to install pm2 (latest 2+ version) locally on my VM (Centos 7). I tried using different versions of Node.js (6, 6.5, 6.6, 6.7) - same error on all of them. I tried npm cache clean - no difference...

It works fine for version 1.1.3 - npm install [email protected]

Expected behaviour

Successful installation

Actual behaviour

$ npm install pm2
npm ERR! not a package /tmp/npm-4759-d6043163/tgz.pm2.io/gkt-1.0.0.tgz
npm ERR! Linux 3.10.0-327.28.3.el7.x86_64
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.7.0/bin/node" "/home/vagrant/.nvm/versions/node/v6.7.0/bin/npm" "install" "pm2"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! path /tmp/npm-4759-d6043163/unpack-081b2219/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-4759-d6043163/unpack-081b2219/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-4759-d6043163/unpack-081b2219/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/test/npm-debug.log

Steps to reproduce

mkdir test
npm init
#... (follow steps - enter over and over again, finally yes)
npm install pm2 #(output as above)

Software versions used

OS         : Centos 7
node.js    : v6.7.0
PM2        : 2.0.15 ?

Has anyone seen anything like that?

Edge case

Most helpful comment

Hi again, I rebuild my vagrant box and that failed again. It also fails on windows 10.
Optional dependencies include this "package"(referred directly to tgz file: http://tgz.pm2.io/gkt-1.0.0.tgz) - after downloading the package it contains only one file it contains:

console.log('Smarty Smart Smarter');

and package.json

{
  "name": "gkt",
  "version": "1.0.0",
  "description": "GKT",
  "main": "index.js",
  "author": "God",
  "license": "MIT"
}

Is this a joke?

All 10 comments

npm version?

It's in error message

npm ERR! node v6.7.0
npm ERR! npm  v3.10.3

Cannot reproduce.

In the meantime you can do this:

$ npm install pm2 -g --no-optional

The same result - I would blame npm but tried to check first here(pm2 repo) - maybe somebody has seen it in the past

$ npm install pm2 --no-optional
npm ERR! not a package /tmp/npm-9509-4b53fc57/tgz.pm2.io/gkt-1.0.0.tgz
npm ERR! Linux 3.10.0-327.28.3.el7.x86_64
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.5.0/bin/node" "/home/vagrant/.nvm/versions/node/v6.5.0/bin/npm" "install" "pm2" "--no-optional"
npm ERR! node v6.5.0
npm ERR! npm  v3.10.3
npm ERR! path /tmp/npm-9509-4b53fc57/unpack-93f30297/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-9509-4b53fc57/unpack-93f30297/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-9509-4b53fc57/unpack-93f30297/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/test/npm-debug.log

this time different version of node

npm ERR! node v6.5.0
npm ERR! npm  v3.10.3

and yes - it's probably edge case as it happened only to me from whole office (unknown reason - everybody uses the same vagrant build VMs)

@Cinderella-Man Try downgrading npm / delete npm cache ?

$ npm cache clean
$ rm -rf /tmp/npm-*
$ npm install pm2 --no-optional
npm ERR! not a package /tmp/npm-14926-e8e469f0/tgz.pm2.io/gkt-1.0.0.tgz
npm ERR! Linux 3.10.0-327.28.3.el7.x86_64
npm ERR! argv "/home/vagrant/.nvm/versions/node/v5.0.0/bin/node" "/home/vagrant/.nvm/versions/node/v5.0.0/bin/npm" "install" "pm2" "--no-optional"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! path /tmp/npm-14926-e8e469f0/unpack-62dad498c8f0e4d4bda0776e58ecd0d2/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-14926-e8e469f0/unpack-62dad498c8f0e4d4bda0776e58ecd0d2/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/test/npm-debug.log

I will probably end up with rerunning vagrant build as it looks like this is something terribly wrong with npm.

Hi again, I rebuild my vagrant box and that failed again. It also fails on windows 10.
Optional dependencies include this "package"(referred directly to tgz file: http://tgz.pm2.io/gkt-1.0.0.tgz) - after downloading the package it contains only one file it contains:

console.log('Smarty Smart Smarter');

and package.json

{
  "name": "gkt",
  "version": "1.0.0",
  "description": "GKT",
  "main": "index.js",
  "author": "God",
  "license": "MIT"
}

Is this a joke?

@Cinderella-Man
It is not 'a joke', its a package for analytics purpose, and its an optional dependency for this kind of situation, sadly we can't do more since its npm that should ignore the dependencies if there is a error with it.

gkt: 'http://tgz.pm2.io/gkt-1.0.0.tgz' is listed in dependencies and optional dependencies on npm.
npm info pm2@latest has gtk in the dependency list.

I got around it by doing npm i pm2@latest --no-optional -g --no-shrinkwrap

@scttcper Thank you very much, this workaround works great! Probably some network rules are blocking me from downloading this file using npm.. Closing this one

Was this page helpful?
0 / 5 - 0 ratings