[Pkg-javascript-devel] Bug#930618: node-terser does not install file mentioned in package.json's main field and fails Error: Cannot find module 'terser'

Pirate Praveen praveen at onenetbeyond.org
Sun Jun 16 16:04:27 BST 2019


Package: node-terser
version: 3.14.1-2
severity: grave
Control: tags -1 patch

pravi at andhaka:~/forge/debian/git/js-team/vue.js$ sudo apt install 
node-terser
[sudo] password for pravi:
Sorry, try again.
[sudo] password for pravi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  node-terser
0 upgraded, 1 newly installed, 0 to remove and 1017 not upgraded.
Need to get 0 B/156 kB of archives.
After this operation, 919 kB of additional disk space will be used.
Selecting previously unselected package node-terser.
(Reading database ... 213014 files and directories currently installed.)
Preparing to unpack .../node-terser_3.14.1-2_all.deb ...
Unpacking node-terser (3.14.1-2) ...
Setting up node-terser (3.14.1-2) ...
pravi at andhaka:~/forge/debian/git/js-team/vue.js$ node -e 
"require('terser');"
internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'terser'
    at Function.Module._resolveFilename 
(internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at [eval]:1:1
    at Script.runInThisContext (vm.js:96:20)
    at Object.runInThisContext (vm.js:303:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at evalScript (internal/bootstrap/node.js:587:27)

In package.json, "main": "dist/bundle.js" is specified, which is not 
installed in the node module path.

/usr/share/javascript/terser/bundle.js should be linked to 
/usr/lib/nodejs/terser/dist/bundle.js and libjs-terser added to Depends 
of node-terser.

Patch: 
https://salsa.debian.org/js-team/node-terser/commit/78f0922edff4010c8b9789b3c2c5fe1397fceefe 
available in fix-main-path branch in salsa repo.



More information about the Pkg-javascript-devel mailing list