Symbolic linked node_modules directory causes moving installed package direcoties

priority:low
cli
triaged

(Kazutomo Ikagawa) #1

What I Wanted to Do

Running npm command several times for symbolically linked node_modules does not change the structure of the package being installed.

What Happened Instead

In the second execution of npm, the directory structure of the installed package has been changed.

Reproduction Steps

  1. create symbolic linked node_modules directory
  2. npm init
  3. install some package
  4. run npm install again
$ cd ~
$ mkdir tmp; cd tmp
$ mkdir node_modules
$ mkdir work; cd work
$ ln -s ../node_modules .
$ npm init
$ npm install admin-lte --save
npm WARN deprecated jvectormap@1.2.2: jvectormap is not maintened since Aug 2015. You can use jvectormap-next or jqvmap instead.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN work@1.0.0 No description
npm WARN work@1.0.0 No repository field.

+ admin-lte@2.4.8
added 172 packages from 231 contributors and audited 1836 packages in 9.236s
found 1 moderate severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
  
$ ls node_modules/
JSONStream                 browserify-rsa        deps-sort                 inline-source-map          once                  shell-quote
acorn                      browserify-sign       des.js                    inputmask                  os-browserify         simple-concat
acorn-dynamic-import       browserify-zlib       detective                 insert-module-globals      pace                  slimscroll
acorn-node                 buffer                diffie-hellman            ion-rangeslider            pako                  source-map
admin-lte                  buffer-from           domain-browser            ionicons                   parents               stream-browserify
almond                     buffer-xor            domhelper                 is-buffer                  parse-asn1            stream-combiner2
array-filter               builtin-status-codes  duplexer2                 isarray                    path-browserify       stream-http
array-map                  cached-path-relative  elliptic                  jquery                     path-is-absolute      stream-splicer
array-reduce               charm                 eve-raphael               jquery-knob                path-parse            string_decoder
asn1.js                    chart.js              events                    jquery-mousewheel          path-platform         subarg
assert                     cipher-base           evp_bytestokey            jquery-sparkline           pbkdf2                syntax-error
balanced-match             ckeditor              fastclick                 jquery-ui                  process               through
base64-js                  classie               flot                      json-stable-stringify      process-nextick-args  through2
bn.js                      combine-source-map    font-awesome              jsonify                    public-encrypt        timers-browserify
bootstrap                  concat-map            fs.realpath               jsonparse                  punycode              to-arraybuffer
bootstrap-colorpicker      concat-stream         fullcalendar              jvectormap                 querystring           tty-browserify
bootstrap-datepicker       console-browserify    function-bind             labeled-stream-splicer     querystring-es3       typedarray
bootstrap-daterangepicker  constants-browserify  get-assigned-identifiers  lodash.memoize             randombytes           umd
bootstrap-slider           convert-source-map    glob                      md5.js                     randomfill            undeclared-identifiers
bootstrap-timepicker       core-util-is          has                       miller-rabin               raphael               url
brace-expansion            create-ecdh           hash-base                 minimalistic-assert        read-only-stream      util
brorand                    create-hash           hash.js                   minimalistic-crypto-utils  readable-stream       util-deprecate
browser-pack               create-hmac           hmac-drbg                 minimatch                  resolve               util-extend
browser-resolve            crypto-browserify     htmlescape                minimist                   ripemd160             vm-browserify
browserify                 datatables.net        https-browserify          mkdirp                     safe-buffer           wrappy
browserify-aes             datatables.net-bs     ieee754                   module-deps                select2               xtend
browserify-cipher          date-now              inflight                  moment                     sha.js
browserify-des             defined               inherits                  morris.js                  shasum
  
$ npm install
npm WARN deprecated jvectormap@1.2.2: jvectormap is not maintened since Aug 2015. You can use jvectormap-next or jqvmap instead.
npm WARN work@1.0.0 No description
npm WARN work@1.0.0 No repository field.

moved 171 packages and audited 1836 packages in 6.019s
found 1 moderate severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

$ ls node_modules/
admin-lte

Details

Platform Info

$ npm --versions
{ 'admin-lte': '2.4.8',
  npm: '6.4.0',
  ares: '1.13.0',
  cldr: '32.0',
  http_parser: '2.7.0',
  icu: '60.1',
  modules: '59',
  nghttp2: '1.25.0',
  node: '9.3.0',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.18.0',
  v8: '6.2.414.46-node.15',
  zlib: '1.2.11' }

$ node -p process.platform
linux

(system) #2

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.