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

Error when running publish #3

Closed
zachgrayio opened this issue Sep 7, 2017 · 6 comments
Closed

Error when running publish #3

zachgrayio opened this issue Sep 7, 2017 · 6 comments

Comments

@zachgrayio
Copy link

jdeploy install works like a charm, but when I run jdeploy publish I get the following error: npm ERR! f.replace is not a function

@shannah
Copy link
Owner

shannah commented Sep 8, 2017

Can you post the full error readout? My gut says that it is probably a Node/NPM version error. If you upgrade node and npm to the latest, it should resolve the issue.

@zachgrayio
Copy link
Author

zachgrayio commented Sep 9, 2017

$ cat package.json                                                                 
{
  "bin": {
    "kalk": "jdeploy-bundle/jdeploy.js"
  },
  "author": "zgray@scal.io",
  "description": "A CLI calculator written in Kotlin.",
  "main": "index.js",
  "preferGlobal": true,
  "repository": "https://github.com/zachgrayio/kalk.git",
  "version": "1.0.0",
  "jdeploy": {
    "jar": "kalk-1.0.0/lib/kalk-1.0.0.jar"
  },
  "dependencies": {
    "shelljs": "^0.7.5"
  },
  "license": "ISC",
  "name": "kalk",
  "files": [
    "jdeploy-bundle",
    {
      "dir": "kalk-1.0.0",
      "includes": "lib/*.jar"
    }
  ],
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  }
}
$ npm -v                                                                           
5.3.0
$ node -v                                                                          
v8.4.0
$ jdeploy install                                                                  
Executing copy rule CopyRule{dir=kalk-1.0.0/lib, includes=[kalk-1.0.0.jar], excludes=null}
kalk-1.0.0/lib/.DS_Store does not match any patterns.
kalk-1.0.0/lib/annotations-13.0.jar does not match any patterns.
kalk-1.0.0/lib/cmdloop-0.1.4.jar does not match any patterns.
kalk-1.0.0/lib/kotlin-stdlib-1.1.4.jar does not match any patterns.
up to date in 0.109s
/usr/local/bin/kalk -> /usr/local/lib/node_modules/kalk/jdeploy-bundle/jdeploy.js
/usr/local/lib/node_modules/kalk -> /Users/triggerhippy/code/repos/kalk-dist
$ kalk 2 + 2                                                                      
4.0
$ jdeploy publish                                                                
Executing copy rule CopyRule{dir=kalk-1.0.0/lib, includes=[kalk-1.0.0.jar], excludes=null}
kalk-1.0.0/lib/.DS_Store does not match any patterns.
kalk-1.0.0/lib/annotations-13.0.jar does not match any patterns.
kalk-1.0.0/lib/cmdloop-0.1.4.jar does not match any patterns.
kalk-1.0.0/lib/kotlin-stdlib-1.1.4.jar does not match any patterns.
up to date in 0.105s
/usr/local/bin/kalk -> /usr/local/lib/node_modules/kalk/jdeploy-bundle/jdeploy.js
/usr/local/lib/node_modules/kalk -> /Users/triggerhippy/code/repos/kalk-dist
npm ERR! f.replace is not a function

@shannah
Copy link
Owner

shannah commented Sep 9, 2017

Hmm.. When I download NodeJS/NPM from the nodejs website (via Mac installer), I get these versions:

Steves-iMac:~ shannah$ node -v
v6.11.3
Steves-iMac:~ shannah$ npm -v
3.10.10

With those versions it works fine.

I tried upgrading npm via sudo npm install -g npm but that broke everything so NPM no longer worked at all. -- had to reinstall from installer.

WIll try upgrading node via npm first and then upgrading npm.

One thing worth noting is that running jdeploy install && npm publish should be equivalent to running jdeploy publish.

That might work for you. It is also possible that the shelljs dependency needs to be updated to a newer version to work with these newer versions of node/npm. The latest is 0.7.8. Will need to investigate further.

@zachgrayio
Copy link
Author

zachgrayio commented Sep 9, 2017

Thanks for looking into.

Tried with v0.7.8 of shelljs, same result.

Ran the following with 0.7.8:

$ jdeploy install && npm publish                                           
Executing copy rule CopyRule{dir=kalk-1.1.0/lib, includes=[kalk-1.1.0.jar], excludes=null}
kalk-1.1.0/lib/annotations-13.0.jar does not match any patterns.
kalk-1.1.0/lib/cmdloop-0.1.4.jar does not match any patterns.
kalk-1.1.0/lib/kotlin-stdlib-1.1.4.jar does not match any patterns.
up to date in 0.111s
/usr/local/bin/kalk -> /usr/local/lib/node_modules/kalk/jdeploy-bundle/jdeploy.js
/usr/local/lib/node_modules/kalk -> /Users/triggerhippy/code/repos/kalk-dist
npm ERR! f.replace is not a function

@zachgrayio
Copy link
Author

Seems I may be having issues with NPM moreso than your library. Will keep looking.

@zachgrayio
Copy link
Author

package.json was the culprit:

"files": [
    "jdeploy-bundle",
    {
      "dir": "kalk-1.0.0",
      "includes": "lib/*.jar"
    }
  ]

should have just been

"files": [
    "jdeploy-bundle",
    "kalk-1.0.0"
  ]

I think I found that config in example in the jdeploy docs somewhere, might be worth double checking and updating if needed. Closing out. Great lib btw.

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