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

Example needs autogypi to build and run #3

Closed
brodybits opened this issue Sep 4, 2015 · 4 comments
Closed

Example needs autogypi to build and run #3

brodybits opened this issue Sep 4, 2015 · 4 comments

Comments

@brodybits
Copy link
Contributor

When I tried the code in the Example section it failed with the following output:

gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:357:16)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/brodybits/mynb/bt
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 

I had to first do npm install -g autogypi and run autogypi, then the example worked for me. Also needs a new version of npm as I said in charto/autogypi#1.

@jjrv
Copy link
Member

jjrv commented Sep 4, 2015

autogypi is listed in devDependencies in nbind's package.json, and dependencies in the example. So it should be installed with the steps:

npm install
npm test

There, npm install when run inside the git cloned repo or the example, should install it. Maybe something silently failed when you ran it with older npm installed, or you didn't notice an error message and continued? It sounds like the correct fix is to set the minimum required npm version in package.json so it would fail more spectacularly before even getting close to installing autogypi. I'll need to do the same to autogypi's package.json too. Thanks for reporting.

@jjrv
Copy link
Member

jjrv commented Sep 4, 2015

Another possible fix is to rename autolink and publish it in the global npm namespace instead of the @lib scope. Problem is that the "autolink" name is taken and I don't want to reserve any other name for it either, since it's a utility package only ever meant to be used by autodts and autogypi. Since it has no wider utility, I think it belongs in a scope, but older npm versions lacking scope support will then fail to install nbind correctly for such a minor reason... What do you think is the best option here?

@brodybits
Copy link
Contributor Author

I had already upgraded npm before following the Example section, still had to install autogypi globally and run it manually before I could build it using npm install. But if I change "prepublish" to "install" in the sample package.json, uninstall my autogypi, and remove the artifacts (auto.gypi, build, and node_modules), then I am able to build it using npm install.

If you want to work with older npm versions, you could start all of your utility packages with a prefix that you do not expect anyone will (or should) use. But I we suspect we should be able to expect the users to update npm (or start using newer npm on new system installations) over time.

jjrv pushed a commit that referenced this issue Sep 4, 2015
@jjrv
Copy link
Member

jjrv commented Sep 4, 2015

It seems prepublish was wrong in this case, I replaced it with install and added notes about updating npm. Thanks for the help.

@jjrv jjrv closed this as completed Sep 4, 2015
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