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

NPM install issue - bson module didn't build #177

Open
ghost opened this issue Nov 4, 2014 · 6 comments
Open

NPM install issue - bson module didn't build #177

ghost opened this issue Nov 4, 2014 · 6 comments
Milestone

Comments

@ghost
Copy link

ghost commented Nov 4, 2014

I am reporting this issue for the records mostly - in case it will lineup with another thread one day...

Building a new MEAN stack project from IDE every module dependencies in package.json file were installed from Run As... > npm install but one: mongoose.

mongoose depends on mongodb that depends on bson module: the bson module didn't build from IDE therefore mongoose installation failed.

What let me think this is not a module but an IDE issue is quite simple: $ npm install from a command line is working just fine.

@paulvi paulvi changed the title NPM install issue NPM install issue - bson module didn't build Nov 5, 2014
@paulvi
Copy link
Member

paulvi commented Nov 5, 2014

That is quite possible, because when running npm install from within Eclipse, Java runs in process environment, that is different from OS shell. (I know now better after making simple Maven and Gradle plugins for Eclipse)

What is needed is to know what new process environment lacks, it may be some environment variable

Please add postinstall script in package.json and compare

    "scripts": {
        "test": "echo \"Error: no test specified! Configure in package.json\" && exit 1",
        "postinstall": "node pev.js"
    },

pev.js

console.log(process.env);

no more others ideas so far

@ghost
Copy link
Author

ghost commented Nov 5, 2014

pev.js was never called: looks like NPM exits before reaching it - is this making sense?

I wonder how npm install was implemented in the first place: will it be possible to send it to OS shell instead? I could be wrong but it actually rings a bell: is this not quite similar to an express 4 project generator to be run from OS shell we discussed weeks ago?

@paulvi
Copy link
Member

paulvi commented Nov 5, 2014

to send it to OS shell instead?

Just try to lunch other process from Node and Java and you will see that it will run in bare environment quite different from OS shell. OS shell is cmd on windows.

Try check if package.json has e.g. preinstall option.

The Java code for launching npm is old https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/npm/LaunchConfigurationDelegate.java
and it lacks environment variable handling I added for Node.js

But before blindly adding more environment variables, it would be nice to have some reference docs... What is minimal and needed for npm to run ?

@paulvi paulvi added this to the 0.18 milestone Nov 5, 2014
@ghost
Copy link
Author

ghost commented Nov 5, 2014

0 info it worked if it ends with ok
1 verbose cli [ '/opt/local/bin/node', '/opt/local/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose install where, deps [ '/Projects/mean',
4 verbose install [ 'express',
4 verbose install 'express-session',
4 verbose install 'body-parser',
4 verbose install 'cookie-parser',
4 verbose install 'serve-favicon',
4 verbose install 'morgan',
4 verbose install 'mongoose',
4 verbose install 'jade' ] ]
5 verbose install where, peers [ '
/Projects/mean', [] ]
6 info preinstall [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec preinstall script
9 verbose stack Error: [email protected] preinstall: node pev.js
9 verbose stack spawn ENOENT
9 verbose stack at errnoException (child_process.js:1001:11)
9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:792:34)
10 verbose pkgid [email protected]
11 verbose cwd ~/Projects/mean
12 error Darwin 14.0.0
13 error argv "/opt/local/bin/node" "/opt/local/bin/npm" "install"
14 error node v0.10.33
15 error npm v2.1.6
16 error code ELIFECYCLE
17 error errno ENOENT
18 error syscall spawn
19 error [email protected] preinstall: node pev.js
19 error spawn ENOENT
20 error Failed at the [email protected] preinstall script.
20 error This is most likely a problem with the meanstack package,
20 error not with npm itself.
20 error Tell the author that this fails on your system:
20 error node pev.js
20 error You can get their info via:
20 error npm owner ls meanstack
20 error There is likely additional logging output above.
21 verbose exit [ 1, true ]

@paulvi
Copy link
Member

paulvi commented Nov 6, 2014

I don't see added value in this log

@paulvi
Copy link
Member

paulvi commented Nov 6, 2014

@nodeleaf I have added similar handling on envVar to npm launch.
But I am not testing it against bson module.

So once 0.18 is released, we can return and check this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant