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

JSHint not listed in npm dependencies breaks npm install #44

Closed
ghost opened this issue Dec 20, 2015 · 4 comments
Closed

JSHint not listed in npm dependencies breaks npm install #44

ghost opened this issue Dec 20, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2015

Installing dependencies with npm install fails on freshly cloned repo due to JSHint not being required locally. Adding JSHint to be installed locally "jshint": "2.9.1-rc1" in package.json or npm --save-dev jshint lets setup complete successfully.

$ git clone https://github.com/officert/mongotron.git; cd mongotron/
Cloning into 'mongotron'...
remote: Counting objects: 6056, done.
remote: Total 6056 (delta 0), reused 0 (delta 0), pack-reused 6056
Receiving objects: 100% (6056/6056), 5.23 MiB | 2.43 MiB/s, done.
Resolving deltas: 100% (3918/3918), done.
Checking connectivity... done.
radiance at satori in ~/_scrap/mongotron on master
$ npm i

> bufferutil@1.2.1 install /home/radiance/_scrap/mongotron/node_modules/bufferutil
> node-gyp rebuild

make: Entering directory '/home/radiance/_scrap/mongotron/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory '/home/radiance/_scrap/mongotron/node_modules/bufferutil/build'

> utf-8-validate@1.2.1 install /home/radiance/_scrap/mongotron/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory '/home/radiance/_scrap/mongotron/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory '/home/radiance/_scrap/mongotron/node_modules/utf-8-validate/build'

> electron-prebuilt@0.36.0 postinstall /home/radiance/_scrap/mongotron/node_modules/electron-prebuilt
> node install.js


> Mongotron@1.0.0-alpha.1 postinstall /home/radiance/_scrap/mongotron
> gulp dev-sym-links

module.js:328
    throw err;
    ^

Error: Cannot find module 'jshint/src/cli'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/radiance/_scrap/mongotron/node_modules/gulp-jshint/src/extract.js:1:79)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.6
npm WARN mongodb-core@1.2.28 requires a peer of kerberos@~0.0 but none was installed.
npm WARN gulp-jshint@2.0.0 requires a peer of jshint@2.x but none was installed.
npm WARN karma-jasmine@0.3.6 requires a peer of jasmine-core@* but none was installed.
npm WARN karma-phantomjs-launcher@0.2.1 requires a peer of phantomjs@>=1.9 but none was installed.
npm ERR! Linux 4.1.15-1-lts
npm ERR! argv "/usr/bin/node" "/usr/sbin/npm" "i"
npm ERR! node v5.3.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! Mongotron@1.0.0-alpha.1 postinstall: `gulp dev-sym-links`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Mongotron@1.0.0-alpha.1 postinstall script 'gulp dev-sym-links'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Mongotron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp dev-sym-links
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs Mongotron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls Mongotron
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/radiance/_scrap/mongotron/npm-debug.log

Packing & running the app further on Arch Linux worked without a hitch once this was taken care of.

@officert
Copy link
Owner

Npm should install jshint because it's a peer-dependency of gulp-jshint:

https://github.com/spalger/gulp-jshint/blob/master/package.json

I'm using NPM version 2.14.7, maybe you have an outdated version of NPM that doesn't support peerDeps?

I need to look into this a bit more. Ideally we don't need to add it to our dependencies since we aren't using it directly, but instead using it through gulp-jshint.

@ghost
Copy link
Author

ghost commented Dec 21, 2015

Here's my npm version:

$ npm --version
3.5.2

This might be related to the API changes in npm 3 and this in particular. It'd make sense for gulp-jshint to download the dependency however. Bug on their end?

@officert
Copy link
Owner

Alright so I upgraded my version of NPM to the latest 3.3.12 and I ran into the same issue. Looks like NPM no longer auto installs peer depedencies:

https://github.com/npm/npm/blob/master/CHANGELOG.md#peerdependencies

I just update Mongotron to the latest Node version, 5.3.0, and added a couple new dependencies for things that were peer dependencies before:

58428f7

Everything is up and working again on my system, let me know if you have any other issues running.

@ghost
Copy link
Author

ghost commented Dec 23, 2015

[19:37:03] Finished 'release-lin' after 1.4 min

Thanks for the fix - no issues on my end either now!

@ghost ghost closed this as completed Dec 23, 2015
This issue was closed.
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

1 participant