node.js - How to prevent npm install --save-dev from reordering devDependencies -



node.js - How to prevent npm install <package> --save-dev from reordering devDependencies -

background we're having issues windows build scheme hitting file path long error when node modules folder has items within have paths on 260 characters.

we've discovered adding nested dependency top of devdependencies section fixes issue. assumption when npm sees nested dependency c.1 require package a, declared , available in devdependencies, npm not add together dependency a dependency c.1's node_modules directory.

issue problem i'm seeing on local machine running npm install <package> --save-dev reorders packages in devdependencies alphabetically, order npm process packages , dependencies matters. if check in, build scheme nail same file path long error.

ie if package a comes after package c , dependency c.1 requires package a, npm add together package a node_modules folder of dependency c.1.

i'm not sure if reordering on machine since haven't seen npm reorder dependencies on home machine before.

has seen before or know how stop behavior?

versions node: v0.10.32 npm: v1.4.28

side note: i've read npm 2.0 or future versions analyze dependency hierarchy, find duplicated packages, , reference them 1 time on file system, upgrade npm 2.0 not in image @ time.

the way see working have sort of preinstall script [hopefully] run after dependencies file has been updated before bundle installed. from npm site:

in current version of node, standard way using .gyp file. if have file .gyp extension in root of package, npm run appropriate node-gyp commands automatically @ install time

if doesn't work, need utilize makefile , rewrite package.json file. not out of ordinary projects require sort of pre-compilation - instruct team run separate command installing npm packages.

node.js npm

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -