Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

579
Views
pm ERR! missing script: build. I try to build one js file. I have npm library/

My main code. I has "require('node-rsa')" which in node_modules folder. Is it possible to create one file from this code?

a.js

var testFunct = function test(message) { 
    const NodeRSA = require('node-rsa');
    const key = new NodeRSA(); 
    var k = key.generateKeyPair(); 
    var p = k.exportKey('pkcs1'); 
    return p};
console.log(testFunct())

package.json

{
  "name": "pol",
  "version": "1.0.0",
  "description": "",
  "main": "a.js",
  "dependencies": {
    "node-rsa": "^1.1.1",
    "build": "webpack a.js b.js"
  },
  "devDependencies": {
    "webpack": "^5.58.2"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

webpack.config.js

module.exports = {
    entry: ['a.js'],
    output: {
      path: './build',
      filename: 'bundle.js'
  
    }
  }

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Add this entry to the scripts section of your package.json:

"build": "webpack"

This will trigger webpack, when you run the build action.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!