Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
Node Package Manager Failing on Browserify Script

There are lots of moving parts for this question so I will post everything. I am running npm run build and I get the following:

enter image description here

Here is my build script in package.json file:

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build":"browserify -d app/scripts/src/main.js -o app/scripts/dist/main.js" 
  },
  "browserify":{
    "transform":[
      "babelify",{"presets":["es2015"],"sourceMap":true}
    ]
  },

app.js:

class ChatApp {
  constructor() {
    console.log("Hello World")
  }
}
 export default ChatApp 

main.js:

import ChatApp from './app'
new ChatApp()

Node version: 6.9.4

Browserify version: 14.3.0

UPDATE:

I updated it and still same result.

  "build":"browserify app/scripts/src/main.js -d -o app/scripts/dist/main.js"

This also does not work and gives the same error:

"build":"browserify app/scripts/src/main.js > app/scripts/dist/main.js -d -o"

Also this same result:

"build":"browserify app/scripts/src/main.js > app/scripts/dist/main.js"

UPDATE: Running only the Browserify command from terminal

browserify app/scripts/src/main.js app/scripts/dist/main.js -d -o 
TypeError: Path must be a string.
    at resolve (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:15:19)
    at nr (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:282:24)
    at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:17:13
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I was able to reproduce your error and fixed it by changing the browserify section of your package.json file (note how there's a nested array).

{
  "scripts": {
    "build": "browserify -d app/scripts/src/main.js -o app/scripts/dist/main.js"
  },
  "browserify": {
    "transform": [ [  "babelify", { "presets": [ "es2015" ], "sourceMap": true } ] ]
  },
  "dependencies": {
    "babel-preset-es2015": "^6.24.1",
    "babelify": "^7.3.0"
  }
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda