In the world of Open Source things never go as they should go! And even the seemingly innocuous task of installing the sources and the now consolidated Bootstrap dependencies may hold some surprises. I downloaded the ZIP archive of Bootstrap sources from their official download page.
After extracting the archive into a folder of my choice I started the installation of dependencies as instructed. And, as you can see for yourself, I have had a few complaints.
$ npm install events.js:183░░░░░░⸩ ⠹ extract:postcss-cli: sill extract bundlesize@0.16.0 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:236:12) at PassThrough.Writable.write (_stream_writable.js:287:5) at PassThrough.Writable.end (_stream_writable.js:553:10) at ReadEntry.entry.on (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41) at emitOne (events.js:121:20) at ReadEntry.emit (events.js:211:7) at ReadEntry.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25) at ReadEntry.[maybeEmitEnd] (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12) at ReadEntry.end (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27) at Unpack.[consumeBody] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13) at Unpack.[consumeChunkSub] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40) at Unpack.[consumeChunk] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:362:30) at Unzip.(anonymous function).on.chunk (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59) at emitOne (events.js:116:13) at Unzip.emit (events.js:211:7) at Unzip.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25) events.js:183░░░░░░⸩ ⠼ extract:yargs-parser: sill extract yargs-parser@4.2.1 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:236:12) at PassThrough.Writable.write (_stream_writable.js:287:5) at PassThrough.Writable.end (_stream_writable.js:553:10) at ReadEntry.entry.on (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41) at emitOne (events.js:121:20) at ReadEntry.emit (events.js:211:7) at ReadEntry.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25) at ReadEntry.[maybeEmitEnd] (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12) at ReadEntry.end (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27) at Unpack.[consumeBody] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13) at Unpack.[consumeChunkSub] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40) at Unpack.[consumeChunk] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:362:30) at Unzip.(anonymous function).on.chunk (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59) at emitOne (events.js:116:13) at Unzip.emit (events.js:211:7) at Unzip.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25) WARN tar ENOENT: no such file or directory, open '/Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/.staging/socket.io-client-c6efd21f/dist/socket.io.slim.js' WARN tar ENOENT: no such file or directory, open '/Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/.staging/rollup-f2b9ab81/dist/rollup.es.js' npm WARN bootstrap@4.1.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. npm ERR! cancel after 1 retries!
As I said, with open source software such things happen frequently. The programmer’s job is made, in fact, at least 50% of his time, the resolution of this kind of problems (that have nothing to do with the actual programming). So, I was armed with patience (lowering) and I tried to figure it out.
As you know (if already you delight of these things) Node is a JavaScript interpreter, equipped with APIs that extend its capabilities, which allows the execution of JavaScript scripts in the system environment. NPM is the Node Package Manager and has become an ubiquitous tool, a de facto standard for the development of Web software and the management of packages and dependencies.
However! Following divine insight I thought that the problem of my installation was due to some folder permissions. So I went to look around the place where they are installed all of the packages node, or in the directory /usr/local/lib/node_modules
. Once I checked them in the configuration of the content permissions.
$ ls -lG node_modules/ total 0 drwxr-xr-x 8 your_user_name staff 272 12 Ott 2017 bower drwxr-xr-x 14 your_user_name staff 476 7 Nov 11:33 browserify drwxr-xr-x 22 your_user_name staff 748 26 Mar 2017 cordova drwxr-xr-x 8 your_user_name staff 272 26 Mar 2017 css-select drwxr-xr-x 6 your_user_name staff 204 26 Mar 2017 css-what drwxr-xr-x 16 your_user_name staff 544 26 Mar 2017 generator-wp-bones drwxr-xr-x 9 your_user_name staff 306 26 Mar 2017 graceful-fs drwxr-xr-x 9 your_user_name staff 306 7 Nov 13:46 grunt-cli drwxr-xr-x 9 root staff 306 12 Gen 18:54 js-beautify drwxr-xr-x 11 your_user_name staff 374 12 Ott 2017 jshint drwxrwxr-x 7 your_user_name staff 238 16 Feb 2017 json-beautifier drwxr-xr-x 24 your_user_name staff 816 7 Nov 15:28 less drwxr-xr-x 6 root staff 204 12 Gen 18:54 less-watch-compiler drwxr-xr-x 14 your_user_name staff 476 13 Nov 17:23 live-server drwxr-xr-x 7 your_user_name staff 238 12 Ott 2017 minimatch drwxr-xr-x 27 root staff 918 4 Apr 11:15 npm drwxr-xr-x 11 your_user_name staff 374 26 Mar 2017 npmconf drwxr-xr-x 19 your_user_name staff 646 12 Ott 2017 phonegap drwxr-xr-x 12 your_user_name staff 408 12 Ott 2017 pug drwxr-xr-x 16 your_user_name staff 544 16 Gen 19:14 uuid drwxr-xr-x 6 your_user_name staff 204 26 Mar 2017 yo
And in fact, some directories are owned by root
. That could create some inconvenience. So I changed the owner of all the folders in this way.
$ sudo chown -R your_user_name node_modules
After making this change, I tried again to run npm install
and everything went well, except for some error message that you can ignore (I think).
$ npm install events.js:183░░░░░░⸩ ⠸ extract:minimist: sill extract minimist@1.2.0 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:236:12) at PassThrough.Writable.write (_stream_writable.js:287:5) at PassThrough.Writable.end (_stream_writable.js:553:10) at ReadEntry.entry.on (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41) at emitOne (events.js:121:20) at ReadEntry.emit (events.js:211:7) at ReadEntry.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25) at ReadEntry.[maybeEmitEnd] (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12) at ReadEntry.end (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27) at Unpack.[consumeBody] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13) at Unpack.[consumeChunkSub] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40) at Unpack.[consumeChunk] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:362:30) at Unzip.(anonymous function).on.chunk (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59) at emitOne (events.js:116:13) at Unzip.emit (events.js:211:7) at Unzip.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25) > fsevents@1.1.3 install /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/fsevents > node install [fsevents] Success: "/Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile > uws@9.14.0 install /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/uws > node-gyp rebuild > build_log.txt 2>&1 || exit 0 > iltorb@1.3.10 install /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/iltorb > detect-libc prebuild-install || node-gyp rebuild prebuild-install info begin Prebuild-install version 2.5.1 prebuild-install info looking for local prebuild @ prebuilds/iltorb-v1.3.10-node-v57-darwin-x64.tar.gz prebuild-install info looking for cached prebuild @ /Users/your_user_name/.npm/_prebuilds/https-github.com-MayhemYDG-iltorb-releases-download-v1.3.10-iltorb-v1.3.10-node-v57-darwin-x64.tar.gz prebuild-install http request GET https://github.com/MayhemYDG/iltorb/releases/download/v1.3.10/iltorb-v1.3.10-node-v57-darwin-x64.tar.gz prebuild-install http 200 https://github.com/MayhemYDG/iltorb/releases/download/v1.3.10/iltorb-v1.3.10-node-v57-darwin-x64.tar.gz prebuild-install info downloading to @ /Users/your_user_name/.npm/_prebuilds/https-github.com-MayhemYDG-iltorb-releases-download-v1.3.10-iltorb-v1.3.10-node-v57-darwin-x64.tar.gz.29945-29ba072d5c85f.tmp prebuild-install info renaming to @ /Users/your_user_name/.npm/_prebuilds/https-github.com-MayhemYDG-iltorb-releases-download-v1.3.10-iltorb-v1.3.10-node-v57-darwin-x64.tar.gz prebuild-install info unpacking @ /Users/your_user_name/.npm/_prebuilds/https-github.com-MayhemYDG-iltorb-releases-download-v1.3.10-iltorb-v1.3.10-node-v57-darwin-x64.tar.gz prebuild-install info unpack resolved to /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/iltorb/build/bindings/iltorb.node prebuild-install info unpack required /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/iltorb/build/bindings/iltorb.node successfully prebuild-install info install Successfully installed prebuilt binary! > node-sass@4.7.2 install /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/darwin-x64-57_binding.node Download complete ⸩ ⠋ : Binary saved to /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/node-sass/vendor/darwin-x64-57/binding.node Caching binary to /Users/your_user_name/.npm/node-sass/4.7.2/darwin-x64-57_binding.node > node-sass@4.7.2 postinstall /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/node-sass > node scripts/build.js Binary found at /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/node-sass/vendor/darwin-x64-57/binding.node Testing binary Binary is fine > nodemon@1.17.2 postinstall /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/nodemon > node -e "console.log('\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n')" || exit 0 Love nodemon? You can now support the project via the open collective: > https://opencollective.com/nodemon/donate > sinon@4.4.6 postinstall /Users/your_user_name/Sites/bootstrap_cv_15-04-2018/node_modules/sinon > node -e "console.log('\u001b[32mLove sinon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/sinon/donate\u001b[0m\n')" || exit 0 Love sinon? You can now support the project via the open collective: > https://opencollective.com/sinon/donate npm WARN bootstrap@4.1.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. added 1600 packages from 1445 contributors in 62.771s